06.01.2011, 17:17
If the reason is blank then your code is wrong. Why would "Reason" not be a string?.
And why don't you use sscanf?
This makes alot more sense.
And why don't you use sscanf?
pawn Код:
dcmd_report(playerid, params[])
{
new giveplayer, reason[24], string[64], player[MAX_PLAYER_NAME];;
if (sscanf(params, "us", giveplayer, reason)) return SendClientMessage(playerid, COLOR_YELLOW, "[ERROR] Right Usage: /report [ID/Part of Name] [Reason]");
else
{
GetPlayerName(playerid, player, sizeof(player));
format(string, 128, "[REPORT] [%d]%s reported [%d]%s || reason: %s", playerid, player, giveplayer, giveplayer, reason);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PInfo[i][Level] >= 1)
{
SendClientMessage(i, LIGHTBLUE, string);
}
}
return 1;
}
}