[AJUDA] Help-Me *-*
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new tmp[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/veiculo", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
            return 1;
        }
        new ID;
        ID = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
            return 1;
        }
        new Cor1;
        Cor1 = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
            return 1;
        }
        new Cor2;
        Cor2 = strval(tmp);
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        CreateVehicle(ID, X+2, Y, Z, 0.0, Cor1, Cor2, 60000);
        SendClientMessage(playerid,0x00FF00AA,"Veiculo Criado");
        return 1;
    }
    return 0;
}

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;
}
Reply


Messages In This Thread
[AJUDA] Help-Me *-* - by duany123 - 10.11.2010, 21:55
Re: [AJUDA] Help-Me *-* - by [FeK]HigorOliver - 10.11.2010, 21:57
Re: [AJUDA] Help-Me *-* - by Kasura - 10.11.2010, 21:58
Re: [AJUDA] Help-Me *-* - by TiagoPS - 10.11.2010, 22:05
Re: [AJUDA] Help-Me *-* - by duany123 - 10.11.2010, 22:17
Re: [AJUDA] Help-Me *-* - by TiagoPS - 10.11.2010, 22:36

Forum Jump:


Users browsing this thread: 2 Guest(s)