Raised This Month: $ Target: $400
 0% 

Ignoring (id) from a command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 05-12-2010 , 09:23   Re: Ignoring (id) from a command
Reply With Quote #1

Make the function something like this:
PHP Code:
public ButtonUse(entid)
{
    if(
is_user_connected(id) && get_pcvar_num(dr_status))
    {        
        new 
target[32]
        
pev(entpev_targetnametarget31)
        
        if(
equal(target"winbut")) { // End-Button
            
            
new szName[32]
            
get_user_name(idszName31)
            
ChatColor(id"%L"LANG_PLAYER"WON"szName)
            
            
cs_set_user_deaths(idget_user_deaths(id) - 1);
            
ButtonUsed true
            
            
if(get_pcvar_num(dr_lives))
                
g_Respawns[id]++;
            if(
get_pcvar_num(dr_stats))
                
g_Wins[id]++;
                
            new 
Players[32
            new 
playerCountiplayerdr
            get_players
(PlayersplayerCount"a"
            
            for (
i=0i<playerCounti++) 
            {
                
playerdr Players[i]
                
set_user_frags(idget_user_frags(id) + get_pcvar_num(dr_winfrags))
                                if(
id)
                    return 
PLUGIN_HANDLED
                user_silentkill
(playerdr)
            }
        }
    }
    return 
PLUGIN_HANDLED

Try that.

Editing messed up indent. I'm too lazy to fix that.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-12-2010 , 16:07   Re: Ignoring (id) from a command
Reply With Quote #2

PHP Code:
public ButtonUse(entid)
{
    if(
is_user_connected(id) && get_pcvar_num(dr_status))
    {        
        new 
target[32]
        
pev(entpev_targetnametarget31)
        
        if(
equal(target"winbut")) { // End-Button
            
            
new szName[32]
            
get_user_name(idszName31)
            
ChatColor(id"%L"LANG_PLAYER"WON"szName)
            
            
cs_set_user_deaths(idget_user_deaths(id) - 1);
            
ButtonUsed true
            
            
if(get_pcvar_num(dr_lives))
                
g_Respawns[id]++;
            if(
get_pcvar_num(dr_stats))
                
g_Wins[id]++;
            
            
set_user_frags(idget_user_frags(id) + get_pcvar_num(dr_winfrags)) // shouldn't be inside the loop
                
            
new Players[32
            new 
playerCountiplayerdr
            get_players
(PlayersplayerCount"a"
            
            for (
i=0i<playerCounti++) 
            {
                
playerdr Players[i]
    
                if(
id != playerdr// player index from the list is not the winner player index
                    
user_silentkill(playerdr)
            }
        }
    }
    return 
PLUGIN_HANDLED

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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


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