11.10.2012, 19:21
PHP код:
if(!strcmp("/do", cmdtext, true))
{
// Create array...
static
str[128]
;
// Format Array "str"
if(sscanf(cmdtext,"s[128]",str))
return SendClientMessage(playerid,-1,"USAGE: /do [TEXT]");
// Create Array to get name of player
static
name[24] // MaxPlayer name is 24!
;
// Formating message
format(str,sizeof(str),"** %s ((%s))",str,(GetPlayerName(playerid,name,20), name));
// Create floats.
static
Float:X,
Float:Y,
Float:Z
;
// Store Player pos in floats createds.
GetPlayerPos(playerid,X,Y,Z);
// Making loop(otimized).
// Create variables to incremment and to store sever slots.
static
Interator,
MaxPlayer
;
// Reseting variables, after don't show errors.
Interator = 0;
MaxPlayers = GetMaxPlayers();
// Looopiing..
for(; Interator != MaxPlayers; ++Interator)
{
/// if's players near player exibe message.
if(IsPlayerInRangeOfPoint(Interator,5,X,Y,Z))
{
SendClientMessage(Interator,-1,str);
}
}
return 1;
}