This code makes crash Pawno - 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: This code makes crash Pawno (
/showthread.php?tid=633920)
This code makes crash Pawno -
Despacito - 09.05.2017
Can someone tell me why this code makes crash Pawno?
pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && GetOnlinePlayers() < 20) //OP vehicles players limit for normal players
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 520 || GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 447 || GetVehicleModel(vehicleid) == 476)
{
SendClientMessage(playerid,0xAA3333AA,"* You can drive this vehicle only if there are more than 20 players online.");
RemovePlayerFromVehicle(playerid);
return 1;
}
I placed in OnPlayerStateChange
DESPACITOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOO
Re: This code makes crash Pawno -
Toroi - 09.05.2017
Show the entire code. If that's everything you copy-pasted, then it lacks a closing brace.
Re: This code makes crash Pawno -
Despacito - 09.05.2017
pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && GetOnlinePlayers() < 20) //OP vehicles players limit for normal players
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 520 || GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 447 || GetVehicleModel(vehicleid) == 476)
{
SendClientMessage(playerid,0xAA3333AA,"* You can drive this vehicle only if there are more than 20 players online.");
RemovePlayerFromVehicle(playerid);
return 1;
}
Full code.
Re: This code makes crash Pawno -
Despacito - 09.05.2017
Ah damn braces! Fixed!
DE
SPA
CITOOOO
Re: This code makes crash Pawno -
Toroi - 09.05.2017
Well, then close the unclosed brace.
EDIT: 10-4