Raised This Month: $ Target: $400
 0% 

get_players issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-19-2013 , 09:55   get_players issue
Reply With Quote #1

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?
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 07-19-2013 at 09:57.
GuskiS is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-19-2013 , 10:01   Re: get_players issue
Reply With Quote #2

Debug it then, start by printing the output of num and players if you believe it to be incorrect
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-19-2013 , 10:45   Re: get_players issue
Reply With Quote #3

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.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-19-2013 , 11:47   Re: get_players issue
Reply With Quote #4

Debug it, that is the only way you are going to know what is wrong
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-19-2013 , 12:14   Re: get_players issue
Reply With Quote #5

Interesting, it started to work after shutting down server.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 07-19-2013 , 14:46   Re: get_players issue
Reply With Quote #6

+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 ?
__________________
Preparing to release my plugins..

Last edited by r0ck; 07-19-2013 at 14:46.
r0ck is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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