This code makes crash Pawno
#1

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
Reply
#2

Show the entire code. If that's everything you copy-pasted, then it lacks a closing brace.
Reply
#3

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.
Reply
#4

Ah damn braces! Fixed!

DE
SPA
CITOOOO
Reply
#5

Well, then close the unclosed brace.

EDIT: 10-4
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)