help me with command /report
#6

The problem with your code is here :
Код:
new text;
It should be string.

Also make sure
Код:
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    return name;
}
Solution
pawn Код:
if(strcmp(cmd, "/report", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [Playerid] [text]");
                return 1;
            }
            new para1;
            new text[50];
            para1 = ReturnUser(tmp);
            text = strtok(cmdtext, idx);
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                         format(string, sizeof(string), "Your report has been send to all online admins");
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "%s has report %s.Reason:%s",PlayerName(para1),PlayerName(playerid),text);
                        for(new i =0;i<MAX_PLAYERS;++i)
            if(PlayerInfo[i][pAdmin] >= 1 && IsPlayerConnected(i))
                        {
                            SendClientMessage(i, COLOR_LIGHTBLUE, string);
                        }
                    }
                }
        }
        return 1;
    }
Reply


Messages In This Thread
help me with command /report - by Hugoca - 01.12.2012, 06:02
Re: help me with command /report - by Alcatraz Gaming - 01.12.2012, 06:06
Re: help me with command /report - by Hugoca - 01.12.2012, 06:08
Re: help me with command /report - by [MM]RoXoR[FS] - 01.12.2012, 06:15
Re: help me with command /report - by Hugoca - 01.12.2012, 06:18
Re: help me with command /report - by [MM]RoXoR[FS] - 01.12.2012, 06:49
Re: help me with command /report - by Hugoca - 01.12.2012, 07:02

Forum Jump:


Users browsing this thread: 1 Guest(s)