AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Plugin not works... (https://forums.alliedmods.net/showthread.php?t=168748)

kramesa 10-03-2011 12:29

[HELP] Plugin not works...
 
Help-me with plugin

PHP Code:

#include <amxmodx>

#define MIN 8
#define TIME 10
#define TAG "[Pug MOD]"

public plugin_init()
{
register_plugin("Players Num",AMXX_VERSION_STR,"Capet1nha")
register_logevent("RoundStart",2,"1=Round_Start")
}

public 
RoundStart()
{
if(
get_cvar_num("pug_minplayers") != 10) return PLUGIN_HANDLED;

new 
TOTAL get_playersnum();
new 
WARMUP get_cvar_num("pug_warmup");

if(((
WARMUP == 0) || (WARMUP == 2)) && (TOTAL MIN))
{
set_cvar_num("pug_warmup",1);
set_cvar_num("pug_votemap",1);
set_cvar_num("pug_votemap_enabled",1);

client_print(0,3,"%s Reiniciando em %d segundos: Faltam %d jogadores.",TAG,TIME,(10 TOTAL));

message_begin(MSG_ALL,SVC_INTERMISSION);
message_end();

set_task(float(TIME),"svRestart");
return 
PLUGIN_HANDLED;
}
return 
PLUGIN_CONTINUE;
}

public 
svRestart() server_cmd("restart"); 


Evaldas.Grigas 10-03-2011 14:28

Re: [HELP] Plugin not works...
 
What help do you need?

kramesa 10-03-2011 15:28

Re: [HELP] Plugin not works...
 
is that when you get 8 players on the server it does not restart

enjoi. 10-03-2011 15:39

Re: [HELP] Plugin not works...
 
PHP Code:

if(get_cvar_num("pug_minplayers") != 10) return PLUGIN_HANDLED

to
PHP Code:

if(get_cvar_num("pug_minplayers") != 8) return PLUGIN_HANDLED

idk no clue lol

kramesa 10-03-2011 15:45

Re: [HELP] Plugin not works...
 
PHP Code:

"1=Round_Sta rt" 

or
PHP Code:

"1=Round_Start" 

?

enjoi. 10-03-2011 15:50

Re: [HELP] Plugin not works...
 
im guessing the 2nd one might be wrong just started coding

plowed 10-03-2011 16:08

Re: [HELP] Plugin not works...
 
try

PHP Code:

#include <amxmodx>

#define MIN 8
#define TIME 10
#define TAG "[Pug MOD]"

public plugin_init()
{
register_plugin("Players Num","1.0","Capet1nha")
register_logevent("RoundStart",2,"1=Round_Start")
}

public 
RoundStart()
{
    if(
get_cvar_num("pug_minplayers") != 10) return PLUGIN_HANDLED;

    new 
TOTAL get_playersnum();
    new 
WARMUP get_cvar_num("pug_warmup");

    if(((
WARMUP == 0) || (WARMUP == 2)) && (TOTAL >= MIN))
    {
        
set_cvar_num("pug_warmup",1);
        
set_cvar_num("pug_votemap",1);
        
set_cvar_num("pug_votemap_enabled",1);

        
client_print(0,3,"%s Reiniciando em %d segundos: Faltam %d jogadores.",TAG,TIME,(10 TOTAL));

        
message_begin(MSG_ALL,SVC_INTERMISSION);
        
message_end();

        
set_task(float(TIME),"svRestart");
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE;
}

public 
svRestart() server_cmd("restart"); 


kramesa 10-03-2011 17:25

Re: [HELP] Plugin not works...
 
what is the most cvar to disable it?

kramesa 10-04-2011 14:28

Re: [HELP] Plugin not works...
 
help

enjoi. 10-04-2011 15:31

Re: [HELP] Plugin not works...
 
Don't bump


All times are GMT -4. The time now is 19:33.

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