Reserved Vehicles
#1

I have a problem with this reserved car script.
I have this , right :

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    if(vehicleid == SampleCar1)
    {
        AddVehicleComponent(SampleCar1, 1036);//Right Alien Sideskirt
        AddVehicleComponent(SampleCar1, 1040);//Left Alien Sideskirt
        AddVehicleComponent(SampleCar1, 1034);//Alien Exhaust
        AddVehicleComponent(SampleCar1, 1172);//Front Bumper X-Flow
        AddVehicleComponent(SampleCar1, 1148);//Rear Bumper Alien
        AddVehicleComponent(SampleCar1, 1035);//X-Flow Roof Vent
        AddVehicleComponent(SampleCar1, Cutter_Wheel);
    }
    return 1;
}
and some other stuff to make the car resevred.
Anywayz, when I do /mycar to call mycar, it isn't modded.. Untill i respawn it with driving it into the water or blowing it up..
Need help!

- Kudoz
Reply
#2

This problem occurs only when the server is initialized?
Reply
#3

It happends all the time. If i now restart my server, right. I login, do /mycar and it isn't tuned. I blow it up, the car respawns. Now , when I do /mycar again, mycar is tuned.
Reply
#4

Give me the code for you command called /mycar. I will fix it.
Reply
#5

If your vehicle is modded on respawn.. then why don't you just add this on the first line of /mycar

Код:
SetVehicleToRespawn(vehicleid);
And then under that SetVehiclePos or whatever.

Also note this: OnVehicleSpawn: Called when a vehicle respawns.
Reply
#6

Quote:
Originally Posted by jikesh_jus
Посмотреть сообщение
If your vehicle is modded on respawn.. then why don't you just add this on the first line of /mycar

Код:
SetVehicleToRespawn(vehicleid);
And then under that SetVehiclePos or whatever.
Exactly this is what is needed and this is why i wanted your code of /mycar. Just add this line in your command. If your confused just paste the code of your command here and we will do it for you. Peace

@jikesh_jus - Thanks for sharing your knowledge with others. I've added you three rep points. Have fun xD
Reply
#7

Thanks mates! Ill rep u both!
Reply
#8

SetVehicleToRespawn didn't work. It only made me tele TO my car, and not the car being teled to me. + that it did get respawned but not tuned.
Reply
#9

Give me the code for /mycar. Ill fix it.
Reply
#10

pawn Код:
if(strcmp(cmd, "/mycar", true) == 0)
    {
        new Float:X, Float:Y, Float:Z, Float:Angle, PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        if(strcmp(PlayerName, "Cir.Cuz") == 0)
        {
            GetPlayerPos(playerid, X, Y, Z);
            GetPlayerFacingAngle(playerid, Angle);
            SetVehiclePos(SampleCar1, X, Y, Z);
            SetVehicleZAngle(SampleCar1, Angle);
            PutPlayerInVehicle(playerid, SampleCar1, 0);
        }
        return 1;
    }
    return 0;
}
Thats the /mycar command. Please help
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)