29.03.2015, 21:08
You need to format a string and then send it to a player, wonder how the server did not crash...
Код:
CMD:getping(playerid, params[]) { new targetplayer, string[21]; if(IsPlayerAdmin(playerid)) { if(sscanf(params, "i", targetplayer)) return SendClientMessage(playerid, -1, "SERVER: /getping [id]."); if (!IsPlayerConnected(targetplayer)) return SendClientMessage(playerid, -1, "SERVER: No player found."); format(string, sizeof (string), "Player's ping is %i", GetPlayerPing(targetplayer)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } else { SendClientMessage(playerid, -1, "SERVER: Unknown command."); } return 1; }