OnPlayerStateChange help
#1

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if( oldstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_DRIVER)
    {
        if(IsAdminv(GetPlayerVehicleID(playerid)))
        {
            if(PlayerInfo[playerid][Admin] < 1)
            {
            new vehicleid;
            vehicleid= GetPlayerVehicleID(playerid);
            DestroyVehicle(vehicleid);
            SendClientMessage(playerid, 0xFF0000FF, ""RED"ERROR:"GREY" Unauthorized Vehicle");
            }
        }
    }
    return 1;
}

stock IsAdminv(vehicleid)
{
    new result;
    new model = GetVehicleModel(vehicleid);
    switch(model)
    {
        case 425, 432, 447, 430, 449, 476, 520, 537, 538, 569, 570, 577, 590, 592, 610: result = model;
        default: result = 0;
    }
    return result;
}
this code is deleting the vehicles when they enter in them or spawn them on foot but when they spawn these vehicles while in a vehicle then the script isnt deleting the vehicle

please help me

thanks in advance
Reply


Messages In This Thread
OnPlayerStateChange help - by kesarthakur - 25.09.2014, 09:53
Re: OnPlayerStateChange help - by Ox1gEN - 25.09.2014, 10:06
Re: OnPlayerStateChange help - by kesarthakur - 25.09.2014, 10:09
Re: OnPlayerStateChange help - by M0HAMMAD - 25.09.2014, 11:41
Re: OnPlayerStateChange help - by DaniceMcHarley - 25.09.2014, 12:11
Re: OnPlayerStateChange help - by ranme15 - 25.09.2014, 12:37
Re: OnPlayerStateChange help - by kesarthakur - 25.09.2014, 13:02
Re: OnPlayerStateChange help - by DaniceMcHarley - 25.09.2014, 14:32
Re: OnPlayerStateChange help - by kesarthakur - 25.09.2014, 16:30
Re: OnPlayerStateChange help - by Pottus - 25.09.2014, 17:15

Forum Jump:


Users browsing this thread: 1 Guest(s)