Raised This Month: $ Target: $400
 0% 

how to check if player is...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-11-2007 , 18:12   Re: how to check if player is...
Reply With Quote #2

miscstats.sma, this is checked each time someone dies.
PHP Code:
    if (LastMan)
    {
        new 
cts[32], ts[32], ctsnumtsnum
        
new maxplayers get_maxplayers()
        new 
team
        
        
for (new i=1i<=maxplayersi++)
        {
            if (!
is_user_connected(i) || !is_user_alive(i))
            {
                continue
            }
            
team get_user_team(i)
            if (
team == 1)
            {
                
ts[tsnum++] = i
            
} else if (team == 2) {
                
cts[ctsnum++] = i
            
}
        }
        
        if (
ctsnum == && tsnum == 1)
        {
            new 
ctname[32], tname[32]
            
            
get_user_name(cts[0], ctname31)
            
get_user_name(ts[0], tname31)
            
            
set_hudmessage(0255255, -1.00.3506.06.00.50.15, -1)
            
ShowSyncHudMsg(0g_center1_sync"%s vs. %s"ctnametname)
            
            
play_sound("misc/maytheforce")
        }
        else if (!
g_LastAnnounce)
        {
            new 
oposite 0_team 0
            
            
if (ctsnum == && tsnum 1)
            {
                
g_LastAnnounce cts[0]
                
oposite tsnum
                _team 
0
            
}
            else if (
tsnum == && ctsnum 1)
            {
                
g_LastAnnounce ts[0]
                
oposite ctsnum
                _team 
1
            
}

            if (
g_LastAnnounce)
            {
                new 
name[32]
                
                
get_user_name(g_LastAnnouncename31)
                
                
set_hudmessage(0255255, -1.00.3806.06.00.50.15, -1)
                
ShowSyncHudMsg(0g_center1_sync"%s (%d HP) vs. %d %s%s: %L"nameget_user_health(g_LastAnnounce), opositeg_teamsNames[_team], (oposite == 1) ? "" "S"LANG_PLAYERg_LastMessages[random_num(03)])
                
                if (!
is_user_connecting(g_LastAnnounce))
                {
                    
client_cmd(g_LastAnnounce"spk misc/oneandonly")
                }
            }
        }
    } 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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 11:07.


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