Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2012-10-22, 12:23


RedC







Wiek: 37
Na forum: 5053 dni
Posty: 83

Piwa: 5

Respekt: 50

Witam mam napraw? pojazdu zbindowan? pod klawisz 2
Kod:

if(PRESSED(512) && (GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
{
RepairVehicle(GetPlayerVehicleID(playerid));
}
?aduje auta tylko nie ?aduje motocykli co jest w tym kodzie ?le ? co do id klawisza (512) sprawdza?em w aucie i motocyklu jest taki sam.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Sharyu
Wysłany: 2012-10-22, 16:39


B!4CK

Never give UP!






Wiek: 32
Na forum: 5809 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

Tzn w jaki spos?b nie '?aduje' motocykli ? Powinno dzia?a? normalnie.

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-22, 19:23


RedC







Wiek: 37
Na forum: 5053 dni
Posty: 83

Piwa: 5

Respekt: 50

Tzn. doda?em jeszcze wysy?anie wiadomo?ci, aby sprawdzi? i gdy naprawiam samoch?d to wysy?a wiadomo??, ?e zosta? naprawiony ale gdy siedz? na motocyklu i naciskam 2 to nie wysy?a wiadomo?ci, ani nie naprawia motocyklu (Pod komend? dzia?a)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-22, 20:00


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Kod:

if(PRESSED(512) && IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
}


Spr?buj tak

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-22, 21:03


RedC







Wiek: 37
Na forum: 5053 dni
Posty: 83

Piwa: 5

Respekt: 50

Niestety dalej nie dzia?a ;/
To tak jakby klawisz 512 by? inny na motocyklu ale jest taki sam ...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-22, 21:30


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Spr?buj tego kodu. Znalaz?em go na oficjalnym forum sampa

Kod:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_SUBMISSION))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"Car fixed!");
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-22, 22:54


kacperpopecki

Dem6n6l6gia Brra..






Wiek: 25
Na forum: 5116 dni
Posty: 53
Nick w MP: Kacu_XD

Piwa: 420

Respekt: 46,3

Ostrzeżeń: 100%
To jest banalnie proste :P

Podpis
"Zamiast ust masz p****,
kłamliwy minister ***** rząd sejm senat i wysoką izbę,
ludzie wierzą że system zmieni sytuację w miastach, (ahaha)
kiedyś wierzyli że ziemia jest płaska!"
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-23, 22:25


RedC







Wiek: 37
Na forum: 5053 dni
Posty: 83

Piwa: 5

Respekt: 50

kacperpopecki, Jak tak banalnie proste to mo?esz napisa? jak to zrobi? bo co? nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-25, 16:15


VisztaPL

Producent Muzyczny






Wiek: 29
Na forum: 5174 dni
Posty: 57
Nick w MP: VisztaPL

Piwa: 461

Respekt: 83,6

"CombaT" napisał/a:

Spr?buj tego kodu. Znalaz?em go na oficjalnym forum sampa

Kod:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_SUBMISSION))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"Car fixed!");
}
}
return 1;
}


Te? u?ywa?em tego kodu, on dzia?a, spr?buj RedC.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-25, 16:27


Lukasbank







Wiek: 30
Na forum: 5329 dni
Posty: 249
Nick w MP: [USD]LuXoR[X]

Piwa: 404

Respekt: 136,5
Respekt: 136,5

?apcie m?j kod na reperowanie pojazdu ;;]
to naprawia nawet wgniecione i popsute czesci samochodu
Kod:



if(IsPlayerInAnyVehicle(playerid))
{
new car = GetPlayerVehicleID(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
if(IsCar(car) && (oldkeys & 4 || oldkeys & 1))
{
RemoveVehicleComponent(car, 1010);
AddVehicleComponent(car, 1010);
}
if((newkeys & 512)&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
{
new vid = GetPlayerVehicleID(playerid);
if (vid) RepairVehicle(vid);
SetVehicleHealth(vehicleid, 1000);
SendClientMessage(playerid, Czat_Bialy, "Naprawi?e? sw?j pojazd! ;) ");
return 1;
}
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-25, 16:52


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
"Lukasbank" napisał/a:

new car = GetPlayerVehicleID(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
new vid = GetPlayerVehicleID(playerid);


Co to ma by?? Bo nie rozumiem po co trzy razy tworzy? to samo? To ?e? teraz zab?ysn?? ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-25, 16:55


shiny







Wiek: 35
Na forum: 6130 dni
Posty: 14

Piwa: 17

Respekt: 63

Bo?e (o ile istniejesz), widzisz i nie grzmisz... RedC, ?apaj:
Kod:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys == KEY_SUBMISSION)
{
if (GetPlayerVehicleID(playerid) != -1)
{
if (!IsPlayerInAnyVehicle(playerid)) return 0;
RepairVehicle(GetPlayerVehicleID(playerid));
GameTextForPlayer(playerid, "~h~~h~~b~~h~~h~Pojazd naprawiony", 2000, 5);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-25, 17:11


kacperpopecki

Dem6n6l6gia Brra..






Wiek: 25
Na forum: 5116 dni
Posty: 53
Nick w MP: Kacu_XD

Piwa: 420

Respekt: 46,3

Ostrzeżeń: 100%
Ja bym zrobil tak :

Kod:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Pojazd Naprawiony!");
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}

return 1;
}


Podpis
"Zamiast ust masz p****,
kłamliwy minister ***** rząd sejm senat i wysoką izbę,
ludzie wierzą że system zmieni sytuację w miastach, (ahaha)
kiedyś wierzyli że ziemia jest płaska!"
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-10-25, 20:09


Lukasbank







Wiek: 30
Na forum: 5329 dni
Posty: 249
Nick w MP: [USD]LuXoR[X]

Piwa: 404

Respekt: 136,5
Respekt: 136,5

CombaT, tak musi by? , bo inaczej bug za bugiem
shiny spokojnie nie spinaj :D

Postaw piwo autorowi tego posta
 

 
Tagi: naprawa :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku