Some script help
#10

Report:
pawn Code:
COMMAND:report(playerid,params[])
{
    new id,reason[64];
    if(sscanf(params,"is[64]",id,reason)) return SendClientMessage(playerid,color_red,"USAGE: /report [playerid] [reason]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color_red,"Player not connected.");
    new counter = 0;for(new i = 0;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(PlayerInfo[i][Level] > 0)
        {
            SendClientMessageEx(i,color_orange,"sssisssisss","Incomming report from ",PlayerInfo[playerid][Username],"(",playerid,") Reporting ",PlayerInfo[id][Username],"(",id,"), Reason: ",reason,".");
            counter++;
        }
    }
    printf("%s has reported %s (Reason:%s)",PlayerInfo[playerid][Username],PlayerInfo[id][Username],reason);
    return SendClientMessageEx(playerid,color_orange,"sis","Your report has been sent to all online administrators (",counter," at the moment).");
}
That saves the report in the serverlogs, to be honest /acceptreport seems a bit unusual to me.

Adminchat:
pawn Code:
COMMAND:a(playerid,params[])
{
    if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid,color_red,"You have no permission to use this command!");
    new text[128];
    if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,color_red,"USAGE: /a [text]");
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(PlayerInfo[i][Level] < 1) continue;
        SendClientMessageEx(i,color_yellow,"ssss","Adminchat: ",PlayerInfo[playerid][Username],": {FFFFFF}",text);
    }
    return 1;
}
Reply


Messages In This Thread
Some script help - by Markx - 06.04.2011, 08:05
Re: Some script help - by [DJ]Boki - 06.04.2011, 08:07
Re: Some script help - by Markx - 06.04.2011, 08:08
Re: Some script help - by -Rebel Son- - 06.04.2011, 08:09
Re: Some script help - by Haydz - 06.04.2011, 08:09
Re: Some script help - by [DJ]Boki - 06.04.2011, 08:10
Re: Some script help - by Markx - 06.04.2011, 08:14
Re: Some script help - by -Rebel Son- - 06.04.2011, 08:15
Re: Some script help - by [DJ]Boki - 06.04.2011, 08:15
Re: Some script help - by gamer931215 - 06.04.2011, 08:17
Re: Some script help - by -Rebel Son- - 06.04.2011, 08:17
Re: Some script help - by [DJ]Boki - 06.04.2011, 08:17
Re: Some script help - by Markx - 06.04.2011, 08:19
Re: Some script help - by -Rebel Son- - 06.04.2011, 08:19
Re: Some script help - by Markx - 06.04.2011, 08:22
Re: Some script help - by [DJ]Boki - 06.04.2011, 08:23
Re: Some script help - by Markx - 06.04.2011, 09:03
Re: Some script help - by [DJ]Boki - 06.04.2011, 09:07
Re: Some script help - by Markx - 06.04.2011, 09:20
Re: Some script help - by [DJ]Boki - 06.04.2011, 09:29
Re: Some script help - by Markx - 06.04.2011, 10:27
Re: Some script help - by [DJ]Boki - 06.04.2011, 10:29

Forum Jump:


Users browsing this thread: 4 Guest(s)