SA-MP Forums Archive
Need Simple Admin Script - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Simple Admin Script (/showthread.php?tid=212602)



Need Simple Admin Script - Tonyss23 - 17.01.2011

I need a simple script that the admin team would be to zcmd and that the team / freeze / unfreeze / ban / kick and so on.

Sorry for my bad english.


Re: Need Simple Admin Script - blackwave - 17.01.2011

pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
stock strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(kick,4,cmdtext);
    dcmd(ban,3,cmdtext);
    return 0;
}

dcmd_kick(playerid,params[])
{
    new id,reason,tmp[100],Index;
    tmp = strtok(params,Index);
    id = strval(params);
    reason = strval(tmp);
    if(!strlen(params) || !strval(tmp)) return 0;
    if(!IsPlayerConnected(id)) return 0;
    Kick(id);
    return 1;
}
dcmd_ban(playerid,params[])
{
    new id,reason,tmp[100],Index;
    tmp = strtok(params,Index);
    id = strval(params);
    reason = strval(tmp);
    if(!strlen(params) || !strval(tmp)) return 0;
    if(!IsPlayerConnected(id)) return 0;
    Ban(id);
}



Re: Need Simple Admin Script - Nighel - 17.01.2011

ladmin