Raised This Month: $51 Target: $400
 12% 

Noob problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bladell
Senior Member
Join Date: Jun 2012
Old 11-18-2013 , 12:09   Noob problem
Reply With Quote #1

PHP Code:
    if ( gHasnoobPower[id] )
    {
        
noobs[id] = get_cvar_num("noob_arrows")
        
        if ( 
is_user_alive(id) )
        {
            
noob_morph(id)
        }
        
        if ( 
get_cvar_num("noob_getdeagle") == )
            
shGiveWeapon(id,"weapon_deagle")
    } 
What should I add here to give only 7 bullets/round for a player?The cvar is already setted on 7, but when the player is revived he get other 7 bullets...is there a way to fix it?
Bladell is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 11-18-2013 , 16:54   Re: Noob problem
Reply With Quote #2

Instead of setting noobs[id] = get_cvar_num("noob_arrows")
on spawn, do it on round start instead. You could also add a boolean variable that keeps track if they've gotten their bullets that round (set to true when you give shots then false on round end).
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Bladell
Senior Member
Join Date: Jun 2012
Old 11-19-2013 , 08:14   Re: Noob problem
Reply With Quote #3

PHP Code:
public newRound(id)
{
    
noob_checklevel(id)
    if ( 
gHasnoobPower[id] )
    {
        
noobs[id] = get_cvar_num("noob_arrows")
        
gLastWeapon[id] = -1  // I think the change Weapon automatically gets called on spawn death too...
        
        
if ( get_cvar_num("noob_getdeagle") == )
            
shGiveWeapon(id,"weapon_deagle")
    }

I already tried but doesn't work...this function is executed every time when player is respawned...I don't know why.
PHP Code:
register_event("ResetHUD","newRound","b"
I thought that a solution would to get round timmer, so if player is revived after first 10 seconds of a round he will not receive other bullets.
Bladell is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 11-19-2013 , 11:35   Re: Noob problem
Reply With Quote #4

Search for it. ResetHUD is also called on A LOT more things than just new round so do not use it.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-20-2013 , 10:49   Re: Noob problem
Reply With Quote #5

Use ham to track when a player spawns instead. Way more reliable.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Bladell
Senior Member
Join Date: Jun 2012
Old 11-23-2013 , 07:01   Re: Noob problem
Reply With Quote #6

Jelle, can you give me an example please? Maybe a plugin wich use this way?
Bladell is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-23-2013 , 09:19   Re: Noob problem
Reply With Quote #7

https://forums.alliedmods.net/showthread.php?t=90148

Shows how to use it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
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 20:35.


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