Novo Comando
#2

pawn Код:
if(strcmp(cmdtext,"/sethp", true)==0)
    {
        new tmp[24], idx, id, hp;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, 0xC0C0C0AA, "Digite: /sethp [id] [hp]");

        id = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, 0xC0C0C0AA, "Digite: /sethp [id] [hp]");
        hp = strval(tmp);

        SetPlayerHealth(id, hp);
        return 1;
    }

    if(strcmp(cmdtext,"/setcolete", true)==0)
    {
        new tmp[24], idx, id, colete;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, 0xC0C0C0AA, "Digite: /setcolete [id] [colete]");

        id = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, 0xC0C0C0AA, "Digite: /setcolete [id] [colete]");
        colete = strval(tmp);

        SetPlayerArmour(id, colete);
        return 1;
    }
final do GM

pawn Код:
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;
}
explica melhor esse outro ai do nome.
Reply


Messages In This Thread
Novo Comando - by WolfBR - 05.02.2012, 19:26
AW: Novo Comando - by paulor - 05.02.2012, 19:43
Re: Novo Comando - by makino - 05.02.2012, 19:54
Re: Novo Comando - by WolfBR - 05.02.2012, 19:55
Re: Novo Comando - by makino - 05.02.2012, 19:56
Re: Novo Comando - by paulor - 05.02.2012, 19:58
Re: Novo Comando - by makino - 05.02.2012, 19:59
Re: Novo Comando - by paulor - 05.02.2012, 20:03
Re: Novo Comando - by WolfBR - 05.02.2012, 20:04
Re: Novo Comando - by paulor - 05.02.2012, 20:07

Forum Jump:


Users browsing this thread: 2 Guest(s)