07.05.2011, 14:34
Hello, I got a problem with my /report command. When i do /report 1 test. It just shows the text when you write /report.
this is the code:
Anyone know how to fix this?
Regards, Alex
this is the code:
pawn Код:
CMD:report(playerid,params[])
{
new idx;
new offset = idx;
new result[96];
new string[258];
new sendername[MAX_PLAYER_NAME];
new length = strlen(params);
if(sscanf(params, "ui",playerid,sendername,result))
return SendClientMessage(playerid, RED, "[LOST:RP] /report [ID] [MESSAGE]");
if(PlayerInfo[playerid][pRmute] == 1)
return SendClientMessage(playerid, RED, "[LOST:RP] You are muted from /report, Behave next time");
{
GetPlayerName(playerid, sendername, sizeof(sendername));
while ((idx < length) && (params[idx] <= ' '))
{
idx++;
}
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = params[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
format(string, sizeof(string), "[LOST:RP] Report from [%d]%s: %s",playerid, sendername, (result));
aMessage(RED,string,1);
}
}
return 1;
}
Regards, Alex