AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_players issue (https://forums.alliedmods.net/showthread.php?t=221213)

GuskiS 07-19-2013 09:55

get_players issue
 
So, I have a VIP plugin that respawns player once in a round. Thats what it should do and it worked for sometime, but now, it has stoped working for some players.
PHP Code:

        new team get_user_team(id)
        new 
players[32]
        new 
num 0

        
if(team == 2)
            
get_players(players,num,"ae","CT")
        else if(
team == 1get_players(players,num,"ae","TERRORIST")

        if(
num >= 1)
        {
            
ExecuteHamB(Ham_CS_RoundRespawnid)
            
g_DidDie[id] = true
            vip_glow
(id1)
            static 
Float:originF[3]
            
pev(idpev_originoriginF)
            
emit_sound(id,CHAN_BODY,SOUND_EXPLODE,VOL_NORM,ATTN_NORM,0,PITCH_NORM)
            
entity_blast(originF)
        }
        else 
ColorChat(idNORMAL"CANT SPAWN"

It gives that CANT SPAWN message so they cant spawn, but it sure is that there is alive >=1 player for that team. Whats wrong? I think it is that get_players, but why and why now as it worked before just fine?

YamiKaitou 07-19-2013 10:01

Re: get_players issue
 
Debug it then, start by printing the output of num and players if you believe it to be incorrect

GuskiS 07-19-2013 10:45

Re: get_players issue
 
But by looking at that code, does it look ok? It should work, right? Maybe the get_user_team is broken. I can't test it because almost all times I test it, it works, but then I see people not spawning.

YamiKaitou 07-19-2013 11:47

Re: get_players issue
 
Debug it, that is the only way you are going to know what is wrong

GuskiS 07-19-2013 12:14

Re: get_players issue
 
Interesting, it started to work after shutting down server.

r0ck 07-19-2013 14:46

Re: get_players issue
 
+1 to restart server....
This is a very sad bug in get_players , i had some plugins using it and the code in which get_players was used didnt worked of that mod
Example Deathrun manager by xpaw , semiclip sometimes stops (uses get_players) like after some uses , mod changes etc. and wont fix until we restart the server !
Happens rarely but really we have to restart server

I also changed everything from get_players to loop by "for" function in most of the plugins and never bugged in 3yrs
(have multimod server)
Can someone tell how is this possible that even map/mod change doesnt fixes it ?


All times are GMT -4. The time now is 06:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.