27.03.2014, 20:15
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { return 1; } ProxDetector(Float: f_Radius, playerid, string[],col1,col2,col3,col4,col5) { if(WatchingTV[playerid] != 1) { new Float: f_playerPos[3]; GetPlayerPos(playerid, f_playerPos[0], f_playerPos[1], f_playerPos[2]); foreach(Player, i) { if(!BigEar[i]) { if((InsideShamal[playerid] == GetPlayerVehicleID(i) && GetPlayerState(i) == 2) || (InsideShamal[i] == GetPlayerVehicleID(playerid) && GetPlayerState(playerid) == 2) || (InsideShamal[playerid] != INVALID_VEHICLE_ID && InsideShamal[playerid] == InsideShamal[i])) { SendClientMessageEx(i, col1, string); } else if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid)) { if(IsPlayerInRangeOfPoint(i, f_Radius / 16, f_playerPos[0], f_playerPos[1], f_playerPos[2])) { SendClientMessageEx(i, col1, string); } else if(IsPlayerInRangeOfPoint(i, f_Radius / 8, f_playerPos[0], f_playerPos[1], f_playerPos[2])) { SendClientMessageEx(i, col2, string); } else if(IsPlayerInRangeOfPoint(i, f_Radius / 4, f_playerPos[0], f_playerPos[1], f_playerPos[2])) { SendClientMessageEx(i, col3, string); } else if(IsPlayerInRangeOfPoint(i, f_Radius / 2, f_playerPos[0], f_playerPos[1], f_playerPos[2])) { SendClientMessageEx(i, col4, string); } else if(IsPlayerInRangeOfPoint(i, f_Radius, f_playerPos[0], f_playerPos[1], f_playerPos[2])) { SendClientMessageEx(i, col5, string); } } } else SendClientMessageEx(i, col1, string); } } return 1; } ProxDetectorS(Float:radi, playerid, targetid) { if(WatchingTV[playerid] != 1) { if(Spectating[targetid] != 0 && PlayerInfo[playerid][pAdmin] < 2) { return 0; } new Float: fp_playerPos[3]; GetPlayerPos(targetid, fp_playerPos[0], fp_playerPos[1], fp_playerPos[2]); if(IsPlayerInRangeOfPoint(playerid, radi, fp_playerPos[0], fp_playerPos[1], fp_playerPos[2]) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid)) { return 1; } } return 0; }