17.07.2016, 14:37
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER && gTeam[playerid] != TEAM_COP) { switch(GetVehicleModel(GetPlayerVehicleID(playerid))) { case 497, 447, 523, 416, 433, 427, 490, 528, 407, 544, 596, 597, 598, 599, 432, 601, 470, 472, 430, 428: { SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+4); SendClientMessage(playerid, yellow, "** - VEHICLE CMDS: /lock (Lock the vehicle) - /cw (Send a message to the passengers in your car) - /ej (Eject a player from your vehicle) - /ejall (Eject all passengers from your vehicle)**"); new string[64]; format(string, sizeof(string), "- CRIME - Law Enforcement Vehicle Theft - Wanted Level %d ", GetPlayerWantedLevel(playerid)); SendClientMessage(playerid, red, string); for(new i=0;i<MAX_PLAYERS;i++) { if(!IsPlayerConnected(i))continue; if(gTeam[i] == TEAM_COP) { new copmsg[170]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(copmsg, sizeof(copmsg), "- WARNING ALL COPS: Law Enforcement Vehicle Theft By %s (%d)",name,playerid); SendClientMessage(i, COLOR_BLUE, copmsg); } } { if(newstate == PLAYER_STATE_DRIVER && gTeam[playerid] != TEAM_CIV) { switch(GetVehicleModel(GetPlayerVehicleID(playerid))) { case 497, 447, 523, 416, 433, 427, 490, 528, 407, 544, 596, 597, 598, 599, 432, 601, 470, 472, 430, 428: { SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+1); SendClientMessage(playerid, yellow, "** - VEHICLE CMDS: /lock (Lock the vehicle) - /cw (Send a message to the passengers in your car) - /ej (Eject a player from your vehicle) - /ejall (Eject all passengers from your vehicle)**"); new string[64]; format(string, sizeof(string), "*CRIME* Vehicle Theft - Wanted Level %d", GetPlayerWantedLevel(playerid)); SendClientMessage(playerid, red, string); } } } if(newstate == 2) { if(LockVeh[playerid] == true) { GameTextForPlayer(playerid, "~g~Vehicle Unlocked. Use /lock to lock it.", 5000, 5); SendClientMessage(playerid,yellow,"Vehicle unlocked.Use /lock to lock it."); LockVeh[playerid] = false; } } return 1; }