PDA

View Full Version : Help with derby


FaLLenGirL
28/07/2017, 10:13 PM
Hello there. Two days ago i made a simple derby system for my stunt server.
The problem is that, sometimes when i am in derby with another players the game freeze and all seems
to not work. Chat doesn't work, commands doesn't work nothing work. After re-log everything it is just fine.
Does someone know why this problem can appear ? It is not freezing all the server but today i tested with more players, and to some players the game just freeze and for them all players that are in derby minigame looks like they are afk (with that sign in fron of their name that means the player is afk), this thing appear instantly and it doesn't fix by himself just if u relog then everything goes right. I saw that this thing appear to 1, 2 players or to all players that are in derby, sometimes to all server. IDK Why.

*** There is not an infinite loop or something else.. the server don't freeze for all players just for 1, 2 players that are in derby, so i disabled the derby and everything is fine on server but, if i enable the derby back, if i play in it after 3 or 4 rounds this thing happen, the timmer goes very fast (countdown timmer) and it freeze. :mad:

If u need to see the code please reply.

IndependentGaming
28/07/2017, 10:33 PM
does the server freeze for the players when the cars are spawned already or after the cars spawn ?

FaLLenGirL
28/07/2017, 10:37 PM
After the cars spawn, and the derby is started.. not everytime it is happen this thing.. after 3, 4 rounds or sometimes after just 1 round.. idk.. sometimes it's cool till from nowhere the game freeze.

IndependentGaming
28/07/2017, 10:38 PM
What you can try to do, let the players join the mini-game first and let the cars spawn in another virtual world for a couple seconds and then let them spawn back in the virtual world where the mini-game is.

FaLLenGirL
28/07/2017, 10:42 PM
I already made this thing.. this is the mode how i made the minigame. I have the map already created, the vehicles spawns at OnGamemodeInit in virtual world 1, after this, when a player enter the minigame it will be placed in virtual world 2, and the vehicle already spawned in virtual world 1, and it is empty (empty slot = not ocuppied by anyone) it will be linked to the player virtual world (2), but the freeze.. appear.. sometimes..

! Also, the freeze appear when the minigame is already started.. when the players started to play to fall down in water to die.. etc.

Logic_
29/07/2017, 07:48 AM
Is your OnPlayerUpdate returning 0 anywhere? Try debugging your script when this all starts happening.

FaLLenGirL
29/07/2017, 01:09 PM
Is your OnPlayerUpdate returning 0 anywhere? Try debugging your script when this all starts happening.

How to debug if OnPlayerUpdate returns 0 ?

FreAkeD
29/07/2017, 01:41 PM
How to debug if OnPlayerUpdate returns 0 ?

http://wiki.sa-mp.com/wiki/Debugging

You can see if OnPlayerUpdate is returning 0 by scrolling to the bottom where the callback ends and seeing what it returns.

FaLLenGirL
31/07/2017, 05:10 PM
http://wiki.sa-mp.com/wiki/Debugging

You can see if OnPlayerUpdate is returning 0 by scrolling to the bottom where the callback ends and seeing what it returns.

Hello there. I solved the problem, everything was caused by OnPlayerUpdate public. Thanks.
But now, i have a little problem in + at this mingame. After the minigame will spawn the players in their vehicles sometimes they put the player in vehicle and after 1-2 sec they remove the players from vehicle and they lose the mingame, what can be ? Sometimes happens sometimes not. Sometimes to 5-6 players sometimes just to 1 player. I think is something with the "CreateVehicle" or with "PutPlayerInVehicle" IDK. I create the derby vehicles on public "OnGameModeInit" and the map too, and when a player will join the minigame the vehicles are already there, but he is not in a vehicle till the derby timer end. Then the player will be spawned in his slot derby vehicle, but how i said there sometimes it's a problem because sometimes the player is spawned corectly in the vehicle, and sometimes after 1-2 seconds he is removed from the vehicle. Thanks anyway if u can help me with this too it will be very great.. i'm really gratefull to you all guys.

Logic_
04/08/2017, 08:35 AM
Sorry for the bump, are you still having the issue?

Astralis
04/08/2017, 08:47 PM
Maybe you are using some kind of anti car jack or anything that has to do with checking how quick player enters vehicle. That's why it would remove them. Or your derby vehicles aren't created properly and they get messed up by removing people.

mrfelix24777
13/09/2017, 10:30 AM
What kinda derby, there are plenty modes of derby minigames, please be more specific.