[Ajuda] car Sistem
#1

Booom Galera da UE para a UMA Com Filtro Script de CRIAR Carro .. Pos o Comando E!
/ carro [nomeVeiculo] E o Carro ja Aparece! Gostaria de sabre si TEM ESSA Como Modifica FS parбgrafo PODE escolher uma cor do Carro also! Tipo! carro / [nomeVeiculo] [cor1] [COR2] ~ ~ ~ ~ ~ POR FAVOR PLIISS ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Aqui esta o Codigo da FS ~ ~ ~ http://pastebin.com/g5wBhdgM
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    #define COR_VERMELHO 0xFF0000FF
    #define COR_CINZA 0xAFAFAFAA
    new tmp[256];
    new cmd[256];
    new string[256];
    new CreatedCars[100];
    new CreatedCar = 0;
    new idx;
    if(strcmp(cmd, "/veh", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerAdmin(playerid))
            {
                SendClientMessage(playerid, COR_VERMELHO, "   Autorizaзгo insuficiente !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COR_CINZA, "USO: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, COR_CINZA, "   Vehicle Number can't be below 400 ou above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COR_CINZA, "USO: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COR_CINZA, "   Color Number can't be below 0 ou above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COR_CINZA, "USO: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COR_CINZA, "   Color Number can't be below 0 ou above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new carid = CreateVehicle(car, X+1,Y,Z, 0.0, color1, color2,60000);
            CreatedCars[CreatedCar] = carid;
            CreatedCar ++;
            format(string, sizeof(string), "Veнculo criado.", carid);
            SendClientMessage(playerid, COR_VERMELHO, string);
        }
        return 1;
    }
    if(strcmp(cmd, "/repararcarro", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerAdmin(playerid))
            {
                SendClientMessage(playerid, COR_VERMELHO, "   Autorizaзгo insuficiente !");
                return 1;
            }
            if(IsPlayerInAnyVehicle(playerid))
            {
                SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
                SendClientMessage(playerid, COR_CINZA, "   Veнculo Consertado !");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/dvall", true) == 0) //Destroir todos carros q vc criou
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerAdmin(playerid))
            {
                SendClientMessage(playerid, COR_VERMELHO, "   Sem Autorizaзгo");
                return 1;
            }
            for(new i = 0; i < sizeof(CreatedCars); i++)
            {
                if(i != 0)
                {
                    DestroyVehicle(i);
                }
            }
            SendClientMessage(playerid, COR_VERMELHO, "   Veнculos Criados Destruidos !");
        }
        return 1;
    }
    return 1;
}

stock strtok(const string[], &index) //Fim GM
{
    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;
}
Axo q nao era o q vc queria,mas por um lado bom,й sу vc add isso no teu gm,sem precisar ficar carregando Filterscripts.
Reply
#3

Nossa Muitoo obrigadoooo (:

valeuu mesmoo em !

Deus Que Te Ajudee !
Reply
#4

Ai , nй por nada nгo , mais pra que vocк formatou isto :
format(string, sizeof(string), "Veнculo criado.", carid);
Reply
#5

pode me adc msn darkxdll ?
seemcriatividade-.-@hotmail.com ou skype : caio.madson
Reply
#6

Arthur_BiT o Comando /dvall quando uso Destroi todos os carros !
Tem Algum Jeito de separar os carros do spawn para nao ser destruidos ?
Reply
#7

Adicionei .
O comando que ele criou ali no cуdigo nгo funcionou ? '-'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)