25.12.2014, 14:48
pawn Код:
static CurrVehicleID[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(IsAdminv(CurrVehicleID[playerid]))
{
if(PlayerInfo[playerid][Admin] < 1)
{
if(oldstate == PLAYER_STATE_DRIVER) DestroyVehicle(CurrVehicleID[playerid]);
SendClientMessage(playerid, 0xFF0000FF, ""RED"ERROR:"GREY" Unauthorized Vehicle");
}
}
CurrVehicleID[playerid] = GetPlayerVehicleID(playerid);
}
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;
}
plz help me to fix this
it should destroy vehicle and send error message
Thanks in advance