13.08.2014, 00:42
I just fixed the indentation (..I think?), it was really messed up (tons of missing brackets and incorrect placement of return statements) and you're better off using something like ZCMD or sscanf, not strcmp.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerConnected(playerid))
{
new Float: radi, Float: str;
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3]) return SendClientMessage(playerid, vermelho, "Usa: /me [Aзгo]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, roxo, "str");
}
}
return 0; // no clue why you're doing this here but you're better off using "break;"
}
}
}
return 0;
}