17.12.2010, 15:50
Hi all,i maked this report cmd:
But when i compile,my Pawno crashes.
Why?
I've defined the cmd.
Code:
dcmd_report(playerid, params[]) ( new tmp3[128]; tmp3 = strtok(cmdtext, idx); if(!strlen(tmp3)) { SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /report [name/id] [reason]"); return 1; } new targetid = ReturnUser(tmp3); if(targetid != INVALID_PLAYER_ID) { new msg[128],giveplayername[128]; GetPlayerName(targetid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); new reason[128]; reason = bigstrtok(cmdtext, idx); if(!strlen(reason)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /report [playerid] [reason]"); new string[128]; format(string, sizeof(string), "%s reported %s [ID: %d] [ Reason: %s ]", sendername,giveplayername,targetid,reason); SendMessageToAdmins(COLOR_RED, string); print(string); format(string, sizeof(string), "Your report on '%s' has been sent to the current online admins. Thank you.", giveplayername); SendClientMessage(playerid, COLOR_GREEN, string); format(msg,sizeof(string),"%s reported %s [ID: %d] (%s)", sendername,giveplayername,targetid,reason); ReportLog(string); IRC_GroupSay(gGroupID, IRC_CHANNEL, msg); } else if(giveplayerid == INVALID_PLAYER_ID) { new string[128]; format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } return 1; }
Why?
I've defined the cmd.