AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=43)
-   -   Noob problem (https://forums.alliedmods.net/showthread.php?t=230016)

Bladell 11-18-2013 12:09

Noob problem
 
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?

DarkGod 11-18-2013 16:54

Re: Noob problem
 
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).

Bladell 11-19-2013 08:14

Re: Noob problem
 
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.

DarkGod 11-19-2013 11:35

Re: Noob problem
 
Search for it. ResetHUD is also called on A LOT more things than just new round so do not use it.

Jelle 11-20-2013 10:49

Re: Noob problem
 
Use ham to track when a player spawns instead. Way more reliable.

Bladell 11-23-2013 07:01

Re: Noob problem
 
Jelle, can you give me an example please? Maybe a plugin wich use this way?

Jelle 11-23-2013 09:19

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

Shows how to use it.


All times are GMT -4. The time now is 07:18.

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