Event on player count
Hi i made a plugin that turns alltalk on and off, reacting on how many players on the server.
I made it with a cvar put in amxx.cfg, so users of the plugin can put in the number of users they want to. In my code it is set to 4, and it works nicely when player number 5 joins, it turns off all talk, but when player 5 disconnects alltalk dont come back on. Here is my code: Code:
I also tried using plugin_init() instead of roundstart, but that didnt seem to work either, i removed that because i wasnt sure if plugin_init is run on reload or mapchange...... Hope someone can se the error /Lone Wolf |
On client disconnect, check how many players there are then if its less than the cvar, turn alltalk to 0.
|
If the cvar is 4, it should set alltalk 1, so when a client disconnects and number of players is equal or less than 4 it should set it.....
as far as i can see it is what i have coded.....or have i overlooked something ? Code:
Or something like that ? |
is amx_nrPlayer a default cvar?
|
It is one i put in amxx.cfg, not a default amx cvar.
I figured i dint have to register it, when it is put in.... But maby thats the error? /Lone Wolf |
Look below at the updated code.
|
Ill try :)
But one thing i dont understand, why this: Code:
And by doing that, can a user change the number to react on ? |
This is used to register the cvar for how many players..
And yes, you use this line in console: Code:
amx_cvar amx_how_many numberHeres some updated code. Code:
|
You get that ok?
|
Re: Event on player count
Sorry for the wait, my computer crashed.....
And thanks a lot for the help it works nicely :) |
| All times are GMT -4. The time now is 16:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.