Raised This Month: $ Target: $400
 0% 

Looping through all players and getting global variable


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-18-2009 , 15:50   Looping through all players and getting global variable
Reply With Quote #1

PHP Code:
new counted_spawns
public event_deathmsg5()
{
    new 
victim read_data(2)

    if(
get_user_team(victim) == && g_Tickets[victim] > 1)
    {
        
g_Tickets[victim]--
        
set_task(get_pcvar_float(cvar_respawndelay), "respawn_player"victim)
        
client_print(victimprint_chat"Tickets left: %d"g_Tickets[victim])
    }
    
    new 
Players[32], iNum 0i;
    
    
get_players(PlayersiNum"ae""TERRORIST")
    if(
iNum 0)
    {
        for(
0iNum; ++i
            
counted_spawns g_Tickets[Players[i]]
    }

    
set_hudmessage(0255500.020.2713.03.0)
    
ShowSyncHudMsg(0g_msgHudSyncX"Preds Remaining : %i"counted_spawns)


Why it gets only the victim g_Tickets? I've loop it through all players and get all tickets in terrorist team.
It prints always : Preds Remaining : 2 or 1 (it's only victim) . I need to get all terrorist team g_Tickets, so why it won't?
xbatista is offline
Send a message via Skype™ to xbatista
 


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 15:40.


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