Error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error (
/showthread.php?tid=439469)
Error -
[..MonTaNa..] - 25.05.2013
Removed.
Re: Error -
Hoborific - 25.05.2013
pawn Код:
if(newstate == PLAYER_STATE_DRIVER && AdminCar(GetVehicleModel(GetPlayerVehicleID(playerid) ) ) )
You don't finish the line on an if statement ( ; ) and you were missing a few brackets.
Re: Error -
[..MonTaNa..] - 25.05.2013
Removed.
Re: Error -
Kindred - 25.05.2013
Try this:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(IsBeingSpeced[playerid] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(spectatingid[i] == playerid)
{
if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER) PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
if(newstate == PLAYER_STATE_ONFOOT) PlayerSpectatePlayer(i, playerid);
}
}
}
if(newstate == PLAYER_STATE_DRIVER && AdminCar[GetVehicleModel(GetPlayerVehicleID(playerid))])
{
if(!IsCnRAdmin(playerid))
{
RemovePlayerFromVehicle(playerid);
GameTextForPlayer(playerid, "~r~this is an admin vehicle~n~~p~ejected", 4000, 3);
}
}
return 1;
}
Re: Error -
Hernando - 25.05.2013
pawn Код:
if(newstate == PLAYER_STATE_DRIVER && AdminCar[GetVehicleModel(GetPlayerVehicleID(playerid))] )
You had AdminCar( instead of admincar[
AdminCar is a variable, not a function or macro.
Re: Error -
Hoborific - 25.05.2013
Didn't see it was a variable not a function.. I'm out.
Re: Error -
[..MonTaNa..] - 25.05.2013
Removed.
Re: Error -
Hernando - 25.05.2013
show us the /adcar CMD code
Re: Error -
[..MonTaNa..] - 25.05.2013
Removed.
Re: Error -
Hernando - 25.05.2013
show the function for UnknownCMD