/akill cmd ?!
#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


Messages In This Thread
/akill cmd ?! - by Michael@Belgium - 13.01.2011, 17:26
Re: /akill cmd ?! - by Finn - 13.01.2011, 17:27
Re: /akill cmd ?! - by Michael@Belgium - 13.01.2011, 17:29
Re: /akill cmd ?! - by blackwave - 13.01.2011, 17:32
Re: /akill cmd ?! - by Michael@Belgium - 15.01.2011, 12:58
Re: /akill cmd ?! - by DeadAhead - 15.01.2011, 13:00
Re: /akill cmd ?! - by Michael@Belgium - 15.01.2011, 13:15
Re: /akill cmd ?! - by alpha500delta - 15.01.2011, 13:20
Re: /akill cmd ?! - by DevilG - 15.01.2011, 13:34
Re: /akill cmd ?! - by Michael@Belgium - 15.01.2011, 18:23

Forum Jump:


Users browsing this thread: 1 Guest(s)