Skripta koju koristim: fs
Detaljan opis problema: ma pree smo sredili ono da ne pise kod svi Vozilo Upaljeno ali sad nemogu upaliti auto ?
Dio skripte: evo pree sto smo sredivali ono ako treba nesta :D http://balkan-samp.com/forum/index.php?topic=26644.0
ovo smo pree sredivali
public paljenje(playerid)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid,"~y~Vozilo ~g~Upaljeno",3000,3);
}
}
a ovo komanda..
if(strcmp(cmd, "/upalivozilo",true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetTimer("paljenje",3000,false);
GameTextForPlayer(playerid,"~g~Vozilo se ~r~Pali",3000,3);
}
else
{
GameTextForPlayer(playerid,"~r~Nisi u vozilu",2000,3);
}
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno):
aj probaj vako
if(strcmp(cmd, "/upalivozilo",true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetTimer("paljenje(playerid)",3000,false);
GameTextForPlayer(playerid,"~g~Vozilo se ~r~Pali",3000,3);
}
else
{
GameTextForPlayer(playerid,"~r~Nisi u vozilu",2000,3);
}
return 1;
}
Citat: [AG] System32 poslato Jun 11, 2011, 16:05:38 POSLE PODNE
aj probaj vako
if(strcmp(cmd, "/upalivozilo",true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetTimer("paljenje(playerid)",3000,false);
GameTextForPlayer(playerid,"~g~Vozilo se ~r~Pali",3000,3);
}
else
{
GameTextForPlayer(playerid,"~r~Nisi u vozilu",2000,3);
}
return 1;
}
izbacilo warn
C:\Documents and Settings\Antonio\Desktop\[FS]Kontrola Vozila v1.0\filterscripte\kontrola.pwn(113) : warning 217: loose indentation
1. Komanda ti je katastrofalna! Razlog. Pokreces timer ( local ) koji NE ubijas.
2. Komanda NEMOZE raditi sa takvim timerom jer izabere random player-a !
Fix:
new
TIMER_POWER[MAX_PLAYERS];
if(!strcmp(cmd, "/upalivozilo",true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
TIMER_POWER[playerid] = SetTimerEx("paljenje",3000,false,"%d",playerid);
GameTextForPlayer(playerid,"~g~Vozilo se ~r~Pali",3000,3);
}
else if(!IsPlayerInAnyVehicle(playerid))
{
GameTextForPlayer(playerid,"~r~Nisi u vozilu",2000,3);
}
return true;
}
public paljenje(playerid)
{
new
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid,"~y~Vozilo ~g~Upaljeno",3000,3);
KillTimer(TIMER_POWER[playerid]);
}
return true;
}
Citat: [H]265 poslato Jun 11, 2011, 16:12:02 POSLE PODNE
1. Komanda ti je katastrofalna! Razlog. Pokreces timer ( local ) koji NE ubijas.
2. Komanda NEMOZE raditi sa takvim timerom jer izabere random player-a !
Fix:
new
TIMER_POWER[MAX_PLAYERS];
if(!strcmp(cmd, "/upalivozilo",true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
TIMER_POWER[playerid] = SetTimerEx("paljenje",3000,false,"%d",playerid);
GameTextForPlayer(playerid,"~g~Vozilo se ~r~Pali",3000,3);
}
else if(!IsPlayerInAnyVehicle(playerid))
{
GameTextForPlayer(playerid,"~r~Nisi u vozilu",2000,3);
}
return true;
}
public paljenje(playerid)
{
new
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid != INVALID_VEHICLE_ID)
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid,"~y~Vozilo ~g~Upaljeno",3000,3);
KillTimer(TIMER_POWER[playerid]);
}
return true;
}
vidi errore
C:\Documents and Settings\Antonio\Desktop\[FS]Kontrola Vozila v1.0\filterscripte\kontrola.pwn(101) : warning 213: tag mismatch
C:\Documents and Settings\Antonio\Desktop\[FS]Kontrola Vozila v1.0\filterscripte\kontrola.pwn(115) : warning 217: loose indentation
C:\Documents and Settings\Antonio\Desktop\[FS]Kontrola Vozila v1.0\filterscripte\kontrola.pwn(115) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Antonio\Desktop\[FS]Kontrola Vozila v1.0\filterscripte\kontrola.pwn(116) : error 001: expected token: ";", but found "{"
C:\Documents and Settings\Antonio\Desktop\[FS]Kontrola Vozila v1.0\filterscripte\kontrola.pwn(128) : warning 225: unreachable code
C:\Documents and Settings\Antonio\Desktop\[FS]Kontrola Vozila v1.0\filterscripte\kontrola.pwn(128) : warning 217: loose indentation
a vidi linija?
Citat: [AG] System32 poslato Jun 11, 2011, 16:05:38 POSLE PODNE
aj probaj vako
if(strcmp(cmd, "/upalivozilo",true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetTimer("paljenje(playerid)",3000,false);
GameTextForPlayer(playerid,"~g~Vozilo se ~r~Pali",3000,3);
}
else
{
GameTextForPlayer(playerid,"~r~Nisi u vozilu",2000,3);
}
return 1;
}
sredio sam i ovako sam probao i opet neradi kad pisem /upalivozilo dodze ono vozilo se pali i tolko nemoze se upaliti vozilo :S.....