/akill cmd ?!
#1

Yeah, so i've searched a lot to find an akill cmd but every code is with includes, ...
Maybe someone give me the /akill cmd without a include, plugins, ...

Plz help me guys ! I thank you alot ^^

SOLVED
Reply
#2

What does /akill do?
Reply
#3

Quote:
Originally Posted by Finn
Посмотреть сообщение
What does /akill do?
Admin kill

( and btw: i don't have a server with adminlevels, so no adminslevels too )
Reply
#4

Just a basic one. Even though I recommend dcmd, or zcmd + sscanf (Easiest ever, these one I told)
pawn Код:
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[])
{
   new cmd[128],idx,tmp[256];
   cmd = strtok(cmdtext, idx);
   if(!strcmp(cmd, "/akill", true))
   {
        new id;
        tmp = strtok(cmdtext, idx);
        id = strval(tmp);
        if(strlen(tmp) == 0) return false;
        else SetPlayerHealth(id, 0);
    }
    return 0;
}
Reply
#5

Quote:
Originally Posted by blackwave
Посмотреть сообщение
Just a basic one. Even though I recommend dcmd, or zcmd + sscanf (Easiest ever, these one I told)
pawn Код:
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[])
{
   new cmd[128],idx,tmp[256];
   cmd = strtok(cmdtext, idx);
   if(!strcmp(cmd, "/akill", true))
   {
        new id;
        tmp = strtok(cmdtext, idx);
        id = strval(tmp);
        if(strlen(tmp) == 0) return false;
        else SetPlayerHealth(id, 0);
    }
    return 0;
}
yes it works ty xD
Reply
#6

Umm one problem: Thats a very newbie and Wrong way of making commands. Get DCMD and SSCANF2, Belive me, their gonna make life easier on ya.
Reply
#7

Quote:
Originally Posted by DeadAhead
Посмотреть сообщение
Umm one problem: Thats a very newbie and Wrong way of making commands. Get DCMD and SSCANF2, Belive me, their gonna make life easier on ya.
yeah , i know that ... but i dont need it
Reply
#8

ZCMD and SSCANF are much better
Really you should get it
Reply
#9

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
yes it works ty xD
Uh.. You might want to edit it a little bit, because if you put that in your script, everyone can do /akill and kill other players!
Reply
#10

Quote:
Originally Posted by DevilG
Посмотреть сообщение
Uh.. You might want to edit it a little bit, because if you put that in your script, everyone can do /akill and kill other players!
Yeah, i've edit that :

pawn Код:
new cmd[128],idx,tmp[256];
        cmd = strtok(cmdtext, idx);


    if(!strcmp(cmd, "/akill", true, 6))
    {
        if (IsPlayerAdmin(playerid))
        {
        new id;
        tmp = strtok(cmdtext, idx);
        id = strval(tmp);
        if(strlen(tmp) == 0) return false;
        else SetPlayerHealth(id, 0);
        SendClientMessageToAll(COLOR_RED, "Someone is been killed by the admin !");
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)