25.11.2014, 13:23
Consider this: all Pawn variables start with the number 0. If the player is not in vehicle, GetPlayerVehicleID will return 0. In that case, they will match.
Try checking if a player is in vehicle first like so
Try checking if a player is in vehicle first like so
pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerVehicleID(playerid) == sweeper[playerid])
{
if(pInfo[playerid][Darbas] == DARBAS_SLAVEJAS || pInfo[playerid][Admin] >= 2)
{
//bla bla sweeper
}
else
{
KickPlayerOutOfVehicle(playerid);
//bla bla wrong job mate
}
}
else if(GetPlayerVehicleID(playerid) == pizzaboy[playerid]) //pizzaboy
{
if(pInfo[playerid][Darbas] == DARBAS_PICININKAS || pInfo[playerid][Admin] >= 2)
{
//Bla bla pizzaguy stuff
}
else
{
KickPlayerOutOfVehicle(playerid);
//Bla bla not your car
}
}
}