pawn Код:
#define MAX_ADMIN_VEHICLES 20 //Change this
new adminvehicle[MAX_ADMIN_VEHICLES];
new adminvehicles = -1;
stock AddAdminVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2)
{
adminvehicles++;
adminvehicle[adminvehicles] = AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2);
return adminvehicles;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == 2)
{
if(!IsPlayerLuxAdm(playerid))
{
new vehid = GetPlayerVehicleID(playerid);
for(new i; i< MAX_ADMIN_VEHICLES; i++)
{
if(adminvehicle[i] == vehid)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "This is a admin vehicle!");
}
}
}
return 1;
}
Then just do the same as AddStaticVehicle but change it to AddAdminVehicle.