Admin Rcon system
#7

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new sendername[MAX_PLAYER_NAME];
new cmd[128];
cmd = strtok(cmdtext, idx);
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // do something here
        return 1;
    }
    if(strcmp("/report", cmdtext,true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[96];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [text]");
            format(string, sizeof(string), "Report from [%d]%s: %s",playerid, sendername, (result));
            ABroadCast(COLOR_LIGHTYELLOW,string,1);
            SendClientMessage(playerid, COLOR_YELLOW, "Your report message was sent to online administrators, thank you.");
        }
        return 1;
    }
    return 0;
}
Here
Reply


Messages In This Thread
Admin Rcon system - by MeNMyselv - 12.07.2011, 07:21
Re: Admin Rcon system - by WoodPecker - 12.07.2011, 07:25
Re: Admin Rcon system - by MeNMyselv - 12.07.2011, 07:28
Re: Admin Rcon system - by [MG]Dimi - 12.07.2011, 07:28
Re: Admin Rcon system - by WoodPecker - 12.07.2011, 07:30
Re: Admin Rcon system - by MeNMyselv - 12.07.2011, 07:40
Re: Admin Rcon system - by WoodPecker - 12.07.2011, 07:43
Re: Admin Rcon system - by [MG]Dimi - 12.07.2011, 07:44
Re: Admin Rcon system - by Basicz - 12.07.2011, 07:47
Re: Admin Rcon system - by MeNMyselv - 12.07.2011, 07:48

Forum Jump:


Users browsing this thread: 2 Guest(s)