[AJUDA] Erro no /veh
#1

Fiz um cmd /veh para criar veiculo, naum deu erro, mas quando uso desliga o serv e vi no crashinfo o seguinte:

Код:

--------------------------

SA-MP Server: 0.3c R2



Exception At Address: 0x775B22C2



Registers:

EAX: 0x00000024	EBX: 0x0000002A	ECX: 0x004E64F0	EDX: 0x00000000

ESI: 0x00000024	EDI: 0x00000020	EBP: 0x0018F5D0	ESP: 0x0018F5BC

EFLAGS: 0x00010212



Stack:

+0000: 0x034F9814   0x00000000   0x004827BB   0x0018F5F4

+0010: 0x0018F5EC   0x0018F60C   0x004A29BE   0x00000020

+0020: 0x004A300E   0x00000000   0x034F9814   0x00000000

+0030: 0x0000002A   0x004841F4   0x0018F5E4   0x0018F190

+0040: 0x0018F814   0x004A6FE4   0x004C2278   0xFFFFFFFF

+0050: 0x00000000   0x0040551E   0x0000002A   0x00000000

+0060: 0x034F9804   0x0018F63C   0x034206CC   0x004059AF

+0070: 0x00000001   0x00765520   0x00765520   0x00000023

+0080: 0x03427E70   0x00401096   0x00765520   0x034F9814

+0090: 0x034292D8   0x00402BB3   0x00765520   0x0000000C

+00A0: 0x0018F674   0x034F9804   0x00000000   0x00765520

+00B0: 0x00000000   0x4EF13D01   0x00000000   0x000D052C

+00C0: 0x000D052C   0x000D1444   0x000CD47C   0x000D093C

+00D0: 0x000CD47C   0x034206CC   0x034292D8   0x00000000

+00E0: 0x03420020   0x00008C0C   0x00482E5B   0x00765520

+00F0: 0x0018F6DC   0x00000008   0x00765520   0x00000000

+0100: 0x00765520   0x0018F6EC   0x0018F6E0   0x02B61CD0

+0110: 0x034F6720   0x00000000   0x00000000   0x02B61CD0

+0120: 0x00000000   0x034F6720   0x0049CF35   0x00000008

+0130: 0x000CD448   0x0018F828   0x0206C390   0x0018FC54
Comando:
pawn Код:
if(strcmp(cmd, "/veh", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (UserInfo[cAdmin][playerid] < 1337)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Autorizaзгo insuficiente !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Os ids dos carros sгo de 400  a 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 <= 0 || color1 > 256) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 ou above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 <= 0 || color2 > 256) { SendClientMessage(playerid, COLOR_GREY, "   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.0,Y,Z, 0.0, color1, color2,1800);
            CreatedCar ++;
            format(string, sizeof(string), "   Veнculo spawnado de nъmero %d;", carid);
            SendClientMessage(playerid, COLOR_GREY, string);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s usou o comando (/veh).", sendername);
            CmdLog(string);
        }
        return 1;
    }
Reply
#2

Vocк fez? Duvido mas enfim.

pawn Код:
if(strcmp(cmd, "/CriarVeiculo", true, 10) == 0 || strcmp(cmd, "/CV", true) == 0)
    {
        #define Branco 0xFFFFFFFF
        new tmp[128], carro, cor1 = -1, cor2 = -1, string[95], carrocriado;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)){ SendClientMessage(playerid, Branco, "{1E90FF}Uso correto:{FFFFFF} /CriarVeiculo [Modelo] [Cor1] [Cor2]"); return 1; }
        carro = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(carro < 400 || carro > 611) return SendClientMessage(playerid, Branco, "O modelo nгo pode ser maior que {1E90FF}611{FFFFFF} ou menor que {1E90FF}400");
        if(!strlen(tmp)){ SendClientMessage(playerid, Branco, "{1E90FF}Uso correto:{FFFFFF} /CriarVeiculo [Modelo] [Cor1] [Cor2]"); return 1; }
        cor1 = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)){ SendClientMessage(playerid, Branco, "{1E90FF}Uso correto:{FFFFFF} /CriarVeiculo [Modelo] [Cor1] [Cor2]"); return 1; }
        cor2 = strval(tmp);
        format(string, sizeof(string), "Vocк criou um carro modelo {1E90FF}[%d] {FFFFFF}cor {1E90FF}[%d] {FFFFFF}e {1E90FF}[%d]", carro, cor1, cor2);
        SendClientMessage(playerid, Branco, string);
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        carrocriado = CreateVehicle(carro, X, Y, Z-1, 0.0, cor1, cor2, 25000);
        PutPlayerInVehicle(playerid, carrocriado, 0);
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)