11.10.2010, 17:22
Hi .. i have problem with if in OnPlayerKeyStateChange for police on control closest players.. But when player (i) is wanted and he is close from police, so send SCM "Nobody in yours closer not wanted" + GameText "THIS PLAYER IS WANTED", but i want show only gametexts for police "THIS PLAYER IS WANTED" when player (i) is wanted and he is close from police. Sorry for poorly explained. Maybe you can understand from the script.
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(PRESSED(KEY_ACTION) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && iPlayerRole[playerid] == 4) { for(new i=0;i<MAX_PLAYERS;i++) { if(GetDistanceBetweenPlayers(playerid, i) <= 10 && GetPlayerWantedLevel(i) >= 1 && i != playerid) { GameTextForPlayer(i,"~h~~w~Police want you to stop!~n~~r~STOP",5000,4 ); //message for wanted player from police GameTextForPlayer(playerid,"~h~~r~This player is wanted!", 5000, 4); //message for police lastcolor = GetPlayerColor(i); SetPlayerMarkerForPlayer(playerid, i, COLOR_RED); SetTimerEx("oldcolor", 5000, 0,"i",i); //in next public give wanted player his old color.. } else { SendClientMessage(playerid, COLOR_BLUE, "Nobody in yours close not wanted"); } } } return 1; }