30.03.2015, 03:06
pawn Код:
CMD:getping(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "SERVER: Unknown Command");
new targetplayer;
if(sscanf(params, "u", targetplayer)) return SendClientMessage(playerid, -1, "USAGE: /getping [ID]");
if(!IsPlayerConnected(targetplayer) || targetplayer == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player is not connected.");
new str[25];
format(str, sizeof(str), "Player's ping is %i.", GetPlayerPing(targetplayer));
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
return 1;
}
https://github.com/Y-Less/sscanf/wiki