16.03.2011, 20:52
message 40 meters close neighborhood read System --" /local and /l "commands with use
Message :Chat Box and player above get color :0x0074F6AA
Message :Chat Box and player above get color :0x0074F6AA
if(!strcmp(cmdtext, "/local", true) || !strcmp(cmdtext, "/l", true))
{
if(!IsPlayerInRangeOfPoint(playerid, 40, x, y, z))return SendClientMessage(playerid, 0xFFFFFFAA, "You are not close enough.");
//rest of the command
return 1;
}
forward LocalMessage(playerid, text[]);
public LocalMessage(playerid, text[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 40.00, x, y, z))
{
SendClientMessage(i, 0x999999AA, text);
}
}
}
return 1;
}
pawn Код:
|
i don't get it...
use the IsPlayerInRangeOfPoint function in the command: pawn Код:
|