AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [DONE]Code doesn't work correctly... (https://forums.alliedmods.net/showthread.php?t=207838)

Unkolix 02-07-2013 10:41

[DONE]Code doesn't work correctly...
 
I have this code:

PHP Code:

new round
new VIPMenuRound
<...>
    
VIPMenuRound register_cvar("amx_vipmenu_round""2")
    
register_logevent("LogEvent_RoundStart"2"1=Round_Start" );
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
<...>
public 
LogEvent_RoundStart()
{
    
CurrentRound++;
}

public 
Event_RoundRestart()
{
    
CurrentRound=0;
}

public 
cmdvipmenu(id
{
    
round get_pcvar_num (VIPMenuRound)
    if( 
CurrentRound >= round )
    {
        
Showrod(id)
    }


It shouldn't let players use vipmenu until certain round, set by cvar, but it lets use it at first round...

Kard1nal 02-07-2013 10:43

Re: Code doesn't work correctly...
 
You should add for the first round:
PHP Code:

register_logevent("somefunc"2"0=World triggered""1&Restart_Round_")
register_logevent("somefunc"2"0=World triggered""1=Game_Commencing"


Unkolix 02-07-2013 10:46

Re: Code doesn't work correctly...
 
I have this added:
PHP Code:

register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
<...>
public 
Event_RoundRestart()
{
    
CurrentRound=0;



fysiks 02-08-2013 00:33

Re: Code doesn't work correctly...
 
New Round / Player Spawn / Round Start / Round End - do Not mess it

Unkolix 02-08-2013 01:43

Re: Code doesn't work correctly...
 
It works... Thanks fir answers.


All times are GMT -4. The time now is 20:35.

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