Tunned cars
#1

I have this :

pawn Код:
new VIPCars[2];

pawn Код:
VIPCars[0] = AddStaticVehicleEx(460,254.66128540,2936.04052734,1.89999998,0.00000000,1,3,15); //Skimmer
    AddStaticVehicleEx(446,262.49353027,2932.13623047,0.00000000,0.00000000,3,1,15); //Squalo
    AddStaticVehicleEx(562,269.34884644,2905.32299805,7.59999990,24.58367920,-1,-1,15); //Elegy
    AddStaticVehicleEx(562,259.74334717,2901.38208008,7.80000019,24.58190918,-1,-1,15); //Elegy
    AddStaticVehicleEx(562,264.72708130,2903.32470703,7.66618872,23.28979492,-1,-1,15); //Elegy
    VIPCars[1] = AddStaticVehicleEx(562,254.90556335,2899.65332031,8.27947426,23.28552246,-1,-1,15); //Elegy



pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(VIPCars[0] <= vehicleid <= VIPCars[1] && ispassenger==0)
        if(team[playerid] != 8)
            ClearAnimations(playerid),SendClientMessage(playerid,GREEN,"You're not V.I.P.");
    return 1;
}

I wanna make the elegy's tunned with alien (front bumper), x-flow (rear bumper), nitro 10x, hydraulics, x-flow side skirts, bass boost, alien roof.


how do I make it ?
Reply
#2

Server event.
Function.
Reply
#3

thx, and how do I know wich mod id is it ?
Reply
#4

Components list.
Reply
#5

wow thx bro, let me try to make it now
Reply
#6

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(VIPCars[0] <= vehicleid <= VIPCars[1] && ispassenger==0)
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1010);
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1034);
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1035);
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1039);
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1041);
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1049);
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1140);
    AddVehicleComponent(VIPCars[0] <= vehicleid <= VIPCars[1], 1171);
        if(team[playerid] != 8)
            ClearAnimations(playerid),SendClientMessage(playerid,GREEN,"You're not V.I.P.");
    return 1;
}

won't work =/

and how I add paint jobs ?
Reply
#7

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    if(VIPCars[0] <= vehicleid <= VIPCars[1])
    {
        AddVehicleComponent(vehicleid, 1010);
        AddVehicleComponent(vehicleid, 1034);
        AddVehicleComponent(vehicleid, 1035);
        AddVehicleComponent(vehicleid, 1039);
        AddVehicleComponent(vehicleid, 1041);
        AddVehicleComponent(vehicleid, 1049);
        AddVehicleComponent(vehicleid, 1140);
        AddVehicleComponent(vehicleid, 1171);
    }
    return 1;
}
You also need to add them in OnGameModeInit

pawn Код:
for(new i = VIPCars[0]; i <= VIPCars[1]; i++)
{
    AddVehicleComponent(i, 1010);
    AddVehicleComponent(i, 1034);
    AddVehicleComponent(i, 1035);
    AddVehicleComponent(i, 1039);
    AddVehicleComponent(i, 1041);
    AddVehicleComponent(i, 1049);
    AddVehicleComponent(i, 1140);
    AddVehicleComponent(i, 1171);
}
Reply
#8

compiled, let me test it
Reply
#9

didn't work =/

EDIT: it appears when I enter the car, how do I make it appear when the cars spawn ?
Reply
#10

Are you using OnVehicleSpawn callback?
Reply
#11

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    if(VIPCars[0] <= vehicleid <= VIPCars[1])
    {
        AddVehicleComponent(vehicleid, 1010);
        AddVehicleComponent(vehicleid, 1034);
        AddVehicleComponent(vehicleid, 1035);
        AddVehicleComponent(vehicleid, 1039);
        AddVehicleComponent(vehicleid, 1041);
        AddVehicleComponent(vehicleid, 1049);
        AddVehicleComponent(vehicleid, 1140);
        AddVehicleComponent(vehicleid, 1171);
    }
    return 1;
}
this one
Reply
#12

Did you also add the lines I showed in OnGameModeInit after you created vehicles?
Reply
#13

yes

Код:
The message you have entered is too short. Please lengthen your message to at least 8 characters.
Reply
#14

I have this under OnGameModeInit:


pawn Код:
for(new i = VIPCars[0]; i <= VIPCars[1]; i++)
{
    AddVehicleComponent(i, 1034);
    AddVehicleComponent(i, 1035);
    AddVehicleComponent(i, 1036);
    AddVehicleComponent(i, 1040);
    AddVehicleComponent(i, 1147);
    AddVehicleComponent(i, 1148);
    AddVehicleComponent(i, 1087);
    AddVehicleComponent(i, 1010);
    AddVehicleComponent(i, 1086);
}


then I have this :

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    if(VIPCars[0] <= vehicleid <= VIPCars[1])
    {
        AddVehicleComponent(vehicleid, 1034);
        AddVehicleComponent(vehicleid, 1035);
        AddVehicleComponent(vehicleid, 1036);
        AddVehicleComponent(vehicleid, 1040);
        AddVehicleComponent(vehicleid, 1147);
        AddVehicleComponent(vehicleid, 1148);
        AddVehicleComponent(vehicleid, 1087);
        AddVehicleComponent(vehicleid, 1010);
        AddVehicleComponent(vehicleid, 1086);
    }
    return 1;
}

then :

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(VIPCars[0] <= vehicleid <= VIPCars[1] && ispassenger==0)
        if(team[playerid] != 8)
            ClearAnimations(playerid),SendClientMessage(playerid,GREEN,"You're not V.I.P.");
    return 1;
}
Reply
#15

Change all those '<=' to '=='.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)