Need Simple Admin Script
#1

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.
Reply
#2

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);
}
Reply
#3

ladmin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)