SA-MP Forums Archive
Reserved Vehicles - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Reserved Vehicles (/showthread.php?tid=337059)



Reserved Vehicles - Kudoz - 24.04.2012

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


Re: Reserved Vehicles - ViniBorn - 24.04.2012

This problem occurs only when the server is initialized?


Re: Reserved Vehicles - Kudoz - 25.04.2012

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.


Re: Reserved Vehicles - Ballu Miaa - 25.04.2012

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


Re: Reserved Vehicles - Jikesh - 25.04.2012

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.


Re: Reserved Vehicles - Ballu Miaa - 25.04.2012

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


Re: Reserved Vehicles - Kudoz - 25.04.2012

Thanks mates! Ill rep u both!


Re: Reserved Vehicles - Kudoz - 26.04.2012

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.


Re: Reserved Vehicles - Ballu Miaa - 27.04.2012

Give me the code for /mycar. Ill fix it.


Re: Reserved Vehicles - Kudoz - 03.05.2012

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