getping
#2

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; 
}
Reply


Messages In This Thread
getping - by saffierr - 29.03.2015, 21:01
Re: getping - by Evocator - 29.03.2015, 21:08
Re: getping - by CalvinC - 29.03.2015, 21:16
Re: getping - by saffierr - 29.03.2015, 22:05
Re: getping - by Threshold - 30.03.2015, 03:06
Re: getping - by saffierr - 30.03.2015, 13:20
Re: getping - by CalvinC - 30.03.2015, 13:30
Re: getping - by saffierr - 30.03.2015, 13:56
Re: getping - by CalvinC - 30.03.2015, 14:11
Re: getping - by saffierr - 30.03.2015, 14:42

Forum Jump:


Users browsing this thread: 2 Guest(s)