Pick A Random Player Bug on Start
whenever my plugin is on (amx_pugin 1), it will transfer all players to CT and then pick a random player and transfer him to T. (one vs all CT)
here is the method: PHP Code:
Run time error 10: native error (native "cs_set_user_team") then I will transfer myself to CT and will re-turn on the plugin again and it will work. where is the problem and how to avoid such issue? |
Re: Pick A Random Player Bug on Start
Indent your code and add curly brackets to the for loop the compiler is not that smart to determine when the loop ends....
And try again.. |
Re: Pick A Random Player Bug on Start
If you are guaranteed to have players on both teams, why not just pick a player that's already a t to skip instead of switching him twice?
|
Re: Pick A Random Player Bug on Start
Not tested, if I understand correctly that would be it.
Code:
public PickARandomPlayer() |
Re: Pick A Random Player Bug on Start
still the same error:
Run time error 10: native error (native "cs_set_user_team") |
Re: Pick A Random Player Bug on Start
PHP Code:
|
Re: Pick A Random Player Bug on Start
@Bugsy thank you, bro, worked very well :)
but we have a tag mismatch warning on: iPlayingPlayers[ iPlayingPlayersCount ][ CSTeam ] = cstTeam; |
Re: Pick A Random Player Bug on Start
Did you change anything? It compiles clean for me. I would not post code with compile errors or warnings.
Code:
AMX Mod X Compiler 1.9.0.5271 |
Re: Pick A Random Player Bug on Start
I'm using amxmodx 1.8.2 bro :)
|
Re: Pick A Random Player Bug on Start
Upgrade your server
You can try this: PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 10:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.