[Ajuda]/veh
#1

Ae pessoal, preciso de ajuda para como criar um /veh tipo
Somente a pessoa logada como admin ou na Rcon pudesse digitar
/veh [carid] [cor1] [cor2]
se a pessoa digitasse
/veh 541 0 0
viesse o carro do id
como um bulet preto
Reply
#2

pawn Код:
if(strcmp(cmd, "/veh", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 1337)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Dir ist es nicht erlaubt, diesen Befehl zu benutzen!");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [AutoID] [Farbe1] [Farbe2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "Fahrzeug-ID kann nicht unter 400 und ьber 611 sein!"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [Auto] [Farbe1] [Farbe2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "Die Farbe kann nicht unter 0 und ьber 126 sein!"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [AutoID] [Farbe1] [Farbe2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "Die Farbe kann nicht unter 0 und ьber 126 sein!"); return 1; }
            new Float:X5,Float:Y5,Float:Z5;
            GetPlayerPos(playerid, X5,Y5,Z5);
            new carid = CreateVehicle(car, X5,Y5,Z5, 0.0, color1, color2, 60000);
            CreatedCars[CreatedCar] = carid;
            spawncar_gas[carid] = GetVehicleStandartGas(carid);
            CreatedCar ++;
            format(string, sizeof(string), "Fahrzeug %d wurde gespawned.", carid);
            SendClientMessage(playerid, COLOR_GREY, string);
            new pppname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pppname, sizeof(pppname));
            format(string, sizeof(string), "%s /veh", pppname);
            AdmCmdLog(playerid,string);
        }
        return 1;
    }
Reply
#3

pawn Код:
C:\Users\HENRIQUE\Desktop\SA-MP SERVER\GameModes\SSG.pwn(381) : warning 217: loose indentation
C:\Users\HENRIQUE\Desktop\SA-MP SERVER\GameModes\SSG.pwn(381) : error 017: undefined symbol "cmd"
C:\Users\HENRIQUE\Desktop\SA-MP SERVER\GameModes\SSG.pwn(385) : error 017: undefined symbol "tmp"
C:\Users\HENRIQUE\Desktop\SA-MP SERVER\GameModes\SSG.pwn(385) : error 012: invalid function call, not a valid address
C:\Users\HENRIQUE\Desktop\SA-MP SERVER\GameModes\SSG.pwn(385) : warning 215: expression has no effect
C:\Users\HENRIQUE\Desktop\SA-MP SERVER\GameModes\SSG.pwn(385) : error 017: undefined symbol "idx"
C:\Users\HENRIQUE\Desktop\SA-MP SERVER\GameModes\SSG.pwn(385) : fatal error 107: too many error messages on one line
Reply
#4

ajuda ae pessoal
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)