17.07.2016, 11:17
The command itself is really explanatory. Here is my code.
There are no errors or warnings. However when I type /say I get spammed with "You spoke but nobody heard you..." Any ideas?
Thanks for your time.
PHP код:
[CMD:say(playerid,params[])// /say command
{
new string[128], say[100];// Store the intial action
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params, "s[100]",say)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /s [Action]");//Error handling
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerInRangeOfPoint(i, 25.0, x, y, z))
{
format(string,sizeof(string),"*%s says\58 \34%s\34",GetName(playerid),say);//Formats the /shout cmd output
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
else SendClientMessage(playerid, COLOR_SILVER, "You spoke but nobody heard you...");
}
return 1;
}
Thanks for your time.