SA-MP Forums Archive
Server functions do not work with players and 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: Server functions do not work with players and vehicles. (/showthread.php?tid=374531)



[SOLVED] Server functions do not work with players and vehicles. - Yiin - 03.09.2012

Server does not responding to players and vehicle functions like SetPlayerPos, SetPlayerSkin, CreateVehicle, SetVehiclePos and so on. Other things like weather, client messages, timers, textdraws works perfectly. I have only JunkBuster filescript. Gamemode compile without errors, server console is without errors too. Server log- no errors. Plase help.. I dont know what to do at all. One minute it works perfectly, other it doesnt.

EDIT:

Is it normal? When I comment a_samp, a_players and a_vehicles includes, no error appear after compile.
http://i.imgur.com/j4fkr.png

EDIT2: Solved. JunkBuster bug with Useful Functions. Thanks to Virtual1ty!


Re: Server functions do not work with players and vehicles. - Misiur - 03.09.2012

Code required. Also put some debug messages with printf before using these functions


Re: Server functions do not work with players and vehicles. - Yiin - 03.09.2012

Quote:
Originally Posted by Misiur
View Post
Code required. Also put some debug messages with printf before using these functions
I dont realy know what code to post. My gm have ~3800 lines. Vehicles not spawning :
http://i.imgur.com/7dZ6O.png
http://i.imgur.com/Lp2SF.png
http://i.imgur.com/Ox0Vi.png

edit: CreateVehicle functions are in OnGamemodeInit callback.


Re: Server functions do not work with players and vehicles. - Misiur - 03.09.2012

No idea why it isn't working, code is fine, no runtime errors either.

What happens if you try something like:
pawn Code:
printf("Teh id of car #1: %d\n", carshop_car1);
FYI you can use arrays to store car id's


Re: Server functions do not work with players and vehicles. - Yiin - 03.09.2012

Quote:
Originally Posted by Misiur
View Post
No idea why it isn't working, code is fine, no runtime errors either.

What happens if you try something like:
pawn Code:
printf("Teh id of car #1: %d\n", carshop_car1);
FYI you can use arrays to store car id's
Server.cfg - http://i.imgur.com/yIBGF.png
Pawn code && Compiling - http://i.imgur.com/7Gi8x.png
Server console - http://i.imgur.com/BOcxg.png

Last think before this problem i just create some textdraws, nothing more. When i try to spawn, my coordinates is 0,0,0 or 5486465400000.00000, -654534864000000.00000, 4561321230000.00000 (smth like that)


Re: Server functions do not work with players and vehicles. - HuSs3n - 03.09.2012

1. remove JunkBuster and MAPP from your filterscripts then try again (to find out if the problem is caused by the filterscripts or by your gamemode)

2. show your OnPlayerUpdate callback


Re: Server functions do not work with players and vehicles. - Yiin - 03.09.2012

Quote:
Originally Posted by HuSs3n
View Post
1. remove JunkBuster and MAPP from your filterscripts then try again (to find out if the problem is caused by the filterscripts or by your gamemode)

2. show your OnPlayerUpdate callback
OnPlayerUpdate - http://i.imgur.com/wxTAZ.png
server.cfg - http://i.imgur.com/OlXpq.png
Console - http://i.imgur.com/WdO7x.png

This is so strange.


Re: Server functions do not work with players and vehicles. - Misiur - 03.09.2012

If you think that some recent change caused this, revert commit (or simply comment those lines), and check if you are right. If yes - well, you've got a place to start


Re: Server functions do not work with players and vehicles. - Yiin - 03.09.2012

Quote:
Originally Posted by Misiur
View Post
If you think that some recent change caused this, revert commit (or simply comment those lines), and check if you are right. If yes - well, you've got a place to start
Yep, okay.. Thanks for all..


Re: Server functions do not work with players and vehicles. - Amit_B - 03.09.2012

Try using print() when you're using CreateVehicle(). This will allow you to know if the functions are called and doesn't works, or doesn't called at all.