if(Groups[Player[playerid][Group]][CommandTypes] == 1)
stock IsACopCar(vehicleid) { switch(GetVehicleModel(vehicleid)) { case 523,427,528,596,598,597,599,601,497,430: return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(IsACopCar(vehicleid) && !ispassenger) { if(Groups[Player[playerid][Group]][CommandTypes] == 1) { SendClientMessage(playerid, -1, "You are not a cop!"); ClearAnimations(playerid); } } }
Here you go man.
Код:
stock IsACopCar(vehicleid) { switch(GetVehicleModel(vehicleid)) { case 523,427,528,596,598,597,599,601,497,430: return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(IsACopCar(vehicleid) && !ispassenger) { if(Groups[Player[playerid][Group]][CommandTypes] == 1) { SendClientMessage(playerid, -1, "You are not a cop!"); ClearAnimations(playerid); } } } |
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (GetPlayerSurfingVehicleID(playerid) == vehicleid)
{
ClearAnimations(playerid);
}
new model = GetVehicleModel(vehicleid);
if(model == 596)
{
Player[playerid][GotInCopCar]++;
ResetPlayerWeapons(playerid);
GivePlayerSavedWeapons(playerid);
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if (GetPlayerSurfingVehicleID(playerid) == vehicleid) { ClearAnimations(playerid); } new model = GetVehicleModel(vehicleid); if(model == 596) { Player[playerid][GotInCopCar]++; ResetPlayerWeapons(playerid); GivePlayerSavedWeapons(playerid); } if(IsACopCar(vehicleid) && !ispassenger) { if(Groups[Player[playerid][Group]][CommandTypes] == 1) { SendClientMessage(playerid, -1, "You are not a cop!"); ClearAnimations(playerid); } } return 1; }
The stock is a function, meaning you can put it anywhere you want in the script (just not inside of another function or brackets or anything and make sure it's after the #includes).
To add the code to what you already have you can just add it to the bottom. Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if (GetPlayerSurfingVehicleID(playerid) == vehicleid) { ClearAnimations(playerid); } new model = GetVehicleModel(vehicleid); if(model == 596) { Player[playerid][GotInCopCar]++; ResetPlayerWeapons(playerid); GivePlayerSavedWeapons(playerid); } if(IsACopCar(vehicleid) && !ispassenger) { if(Groups[Player[playerid][Group]][CommandTypes] == 1) { SendClientMessage(playerid, -1, "You are not a cop!"); ClearAnimations(playerid); } } return 1; } |
if(Groups[Player[playerid][Group]][CommandTypes] != 1)