if(newstate == PLAYER_STATE_DRIVER) // In OnPlayerStateChange, when he just entered the vehicle.
{
new skin = GetPlayerSkin(playerid);
switch(GetVehicleModel(GetPlayerVehicleID(playerid))
{
case 427, 596, 598, 597, 599: // Here the vehicle models
{
if(skin != 280) // Add more skins yourself
{
SendClientMessage(playerid, COLOR_RED, "You have to be a cop to enter this car!"); // Send a message he isn't a cop
RemovePlayerFromVehicle(playerid); // Remove him from the vehicle
}
}
}
}
CMD:duty(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1) { if (PlayerToPoint(3, playerid,263.8386,109.0965,1004.6172) || PlayerToPoint(3,playerid,263.8386,109.0965,1004.61 72) || PlayerInfo[playerid][pLocal] != 255) { ShowPlayerDialog(playerid, DUTYMENU, DIALOG_STYLE_LIST, "LSPD Menu","Duty\nWeapons\nSWAT\nUniform\nUndercover", "Select", "Cancel"); } else { SendClientMessage(playerid, COLOR_GRAD2, " You are not in a locker room !"); return 1; } } if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1) { if(OnDuty[playerid]==0) { format(string, sizeof(string), "* EMT %s took a Badge from his bag.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); GivePlayerWeapon(playerid, 42, 1000000); OnDuty[playerid] = 1; } else if(OnDuty[playerid]==1) { format(string, sizeof(string), "* EMT %s places his Badge in his bag.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); OnDuty[playerid] = 0; } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not a Cop or EMT!"); } } return 1; } |
if (PlayerToPoint(3, playerid,263.8386,109.0965,1004.6172) || PlayerToPoint(3,playerid,263.8386,109.0965,1004.61 72) || PlayerInfo[playerid][pLocal]
PlayerToPoint(3,playerid,263.8386,109.0965,1004.61 72)