Car remove command?
#9

nice daniel but some parts arent necessary

pawn Код:
new First_Spawned_Car;
pawn Код:
if(strcmp(cmd, "/car", true) == 0)
    {
        if (AdminLevel[playerid] < 5)
            return SendClientMessage(playerid, red, "Your not high enough level to use this command");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /car [carid]");
        new car = strval(tmp);
        if(car < 400 || car > 611)
            return SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 or above 611!");
        new Float:X, Float:Y, Float:Z, Float:A;
        GetPlayerFacingAngle(playerid, A);
        GetPlayerPos(playerid, X, Y, Z);
        X += 5 * floatsin(-A, degrees);
        Y += 5 * floatcos(-A, degrees);
        tmp = strtok(cmdtext, idx);
        if(strlen(tmp))
        {
            new color_1 = strval(tmp);
            new color_2 = strval(strtok(cmdtext, idx));
            if(!First_Spawned_Car) return (First_Spawned_Car = CreateVehicle(car, X, Y, Z, -A, color_1, color_2, -1));
            return CreateVehicle(car, X, Y, Z, -A, color_1, color_2, -1);  
        }
        if(!First_Spawned_Car) return (First_Spawned_Car = CreateVehicle(car, X, Y, Z, -A, -1, -1, -1));
        return CreateVehicle(car, X, Y, Z, -A, -1, -1, -1);
    }
pawn Код:
if(strcmp(cmd, "/destroycar", true) == 0)
    {
        if(AdminLevel[playerid] < 5)
            return SendClientMessage(playerid, red, "Your not high enough level to use this command");
        for(; First_Spawned_Car <= MAX_VEHICLES; First_Spawned_Car++)
            DestroyVehicle(First_Spawned_Car);
        return !(First_Spawned_Car = 0);
    }
Reply


Messages In This Thread
Car remove command? - by bajskorv123 - 18.06.2010, 16:06
Re: Car remove command? - by Despare - 18.06.2010, 16:10
Re: Car remove command? - by bajskorv123 - 18.06.2010, 16:13
Re: Car remove command? - by Despare - 18.06.2010, 16:24
Re: Car remove command? - by bajskorv123 - 18.06.2010, 16:28
Re: Car remove command? - by Despare - 18.06.2010, 16:36
Re: Car remove command? - by bajskorv123 - 18.06.2010, 16:50
Re: Car remove command? - by Despare - 18.06.2010, 16:51
Re: Car remove command? - by Nero_3D - 18.06.2010, 16:57

Forum Jump:


Users browsing this thread: 1 Guest(s)