Closed NegativeIQ closed 8 years ago
Classes are static, even y_classes' classes are static. Once created they can't be removed. y_classes simulates classes on top of the static classes. This can all be done in your script as well, I'm sure this won't be added.
Resetting classes to 0 would be really simple, just modify iSpawnsAvailable
in pNetGame
.
If you want to delete individual ones, all you need to do is splice AvailableSpawns
and decrease iSpawnsAvailable
.
Yep just remove individual ones..Or maybe add another functions like DestroyAllClasses() ? These would be useful for some servers like mini games...
It's possible but only would affect newly connected players
I've did what I can to help you: https://github.com/kurta999/YSF/commit/7c86cb35932f865d4366e62898132f126be4e26c
How about a ResetClasses? Then we could manage local ones and reset the real ones when we want to do something.
Like, I could have an array of classes in my server. I initially add them using AddPlayerClass. Then if I want to remove a few I reset them and add the ones I have left.
https://github.com/kurta999/YSF/commit/e9aa05bb9c30f2b879133bb87b055b536e7cdd1f
for(new i = GetAvailableClasses(); i != 0; i--) { RemoveLastClass(); }
all classes has been reseted.
you can add new with AddPlayerClass
I suggest adding Remove/DestroyClass(classid) as it may be very useful. YSI y_classes have these but i guess i wouldnt hurt to have one more simple function... And add include file with all functions and callbacks to releases (R14-3 and R15 did not have include, and i even wanted to suggest SetPlayerGravity function but checked source and noticed its already there) Also suggesting adding examples for SendRPC and SendData and some more complex functions/callbacks in first post at samp forums.