CMD:bk(playerid,params[]) { new string[128], Float:X, Float:Y, Float:Z; if(pInfo[playerid][Faction] == 1) { GetPlayerPos(playerid, X, Y, Z); format(string, sizeof(string), "(Police Radio): %s is requesting backup at his position.", GetName(playerid)); PoliceBroadcast(COLOR_DARKBLUE,string,1); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { if(pInfo[i][Faction] == 1) { SetPlayerCheckpoint(i, X, Y, Z, 3.0); BackupCP[playerid] = 1; } } } return 1; }
Код:
CMD:bk(playerid,params[]) { new string[128], Float:X, Float:Y, Float:Z; if(pInfo[playerid][Faction] == 1) { GetPlayerPos(playerid, X, Y, Z); format(string, sizeof(string), "(Police Radio): %s is requesting backup at his position.", GetName(playerid)); PoliceBroadcast(COLOR_DARKBLUE,string,1); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { if(pInfo[i][Faction] == 1) { SetPlayerCheckpoint(i, X, Y, Z, 3.0); BackupCP[playerid] = 1; } } } return 1; } |
new TimerGps[MAX_PLAYERS]; CMD:bk(playerid,params[]) { new string[128], Float:X, Float:Y, Float:Z; if(pInfo[playerid][Faction] == 1) { GetPlayerPos(playerid, X, Y, Z); format(string, sizeof(string), "(Police Radio): %s is requesting backup at his position.", GetName(playerid)); PoliceBroadcast(COLOR_DARKBLUE,string,1); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { if(pInfo[i][Faction] == 1) { SetPlayerCheckpoint(i, X, Y, Z, 3.0); TimerGps[i]=SetTimerEx("playerpostion", 1000, 1,"dd",i,playerid); BackupCP[playerid] = 1; } } } return 1; } forward playerpostion(i,playerid); public playerpostion(i,playerid) { DisablePlayerCheckpoint(i); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerCheckpoint(i, x,y,z, 3.0); } CMD:dbk(playerid,params[]) { DisablePlayerCheckpoint(playerid); KillTimer(TimerGps[playerid]); return 1; }