SA-MP Forums Archive
Taxi light object not showing - 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: Taxi light object not showing (/showthread.php?tid=655999)



Taxi light object not showing - Adamoneoone - 04.07.2018

Hello, i'm trying to getthe taxi sign to light up when you do /taxi, here is my code, nothing happens:
I've made it using the https://sampforum.blast.hk/showthread.php?tid=282883 script to make it.

PHP Code:
new vehFloat:Pos[4];
GetPlayerPos(playeridFloat:Pos[0], Float:Pos[1], Float:Pos[2]);
GetPlayerFacingAngle(playeridFloat:Pos[3]); veh CreateVehicle(420Float:Pos[0], Float:Pos[1], Float:Pos[2], Float:Pos[3], -1, -150000);
AttachObjectToVehicle(VehicleObject[0], veh0.000000,-0.415,0.920.000000,0.000000,0.000000);
VehicleObject[0] = CreateObject(19294,0,0,-1000,0,0,0,100); 
Thanks for your help.


Re: Taxi light object not showing - m3shys - 04.07.2018

You are using VehicleObject[0] prior to defining it.


Re: Taxi light object not showing - Adamoneoone - 05.07.2018

Quote:
Originally Posted by m3shys
View Post
You are using VehicleObject[0] prior to defining it.
Oh I did, just didn't post that, it was
PHP Code:
new VehicleObject[1]; 



Re: Taxi light object not showing - 4D1L - 05.07.2018

Swap lines 04 & 05 around (starting from line 00). I am presuming VehicleObject[0] is empty at line 04 since you assign it a value (CreateObject(19294,0,0,-1000,0,0,0,100)) in line 05.


Re: Taxi light object not showing - Sew_Sumi - 06.07.2018

^^ That will be correct.


Re: Taxi light object not showing - Adamoneoone - 06.07.2018

Quote:
Originally Posted by Sew_Sumi
View Post
^^ That will be correct.
Quote:
Originally Posted by 4D1L
View Post
Swap lines 04 & 05 around (starting from line 00). I am presuming VehicleObject[0] is empty at line 04 since you assign it a value (CreateObject(19294,0,0,-1000,0,0,0,100)) in line 05.
Quote:
Originally Posted by m3shys
View Post
You are using VehicleObject[0] prior to defining it.
Oh alright thank you all, I tested it and nothing showed up, however changing the weather using /rcon weather and putting a rainy one did the trick, the light showed up. However, the light is blinking, any idea how to make it persistent? Thanks


Re: Taxi light object not showing - Sew_Sumi - 06.07.2018

Weather shouldn't affect it... Try the code on a bare script, and then if it comes fine there, then something else on the server is messing with it.

If you're using the streamer, that'll cause trouble as you should be using the streamers object functions, not the vanilla sa-mp ones.