AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Level + flag (https://forums.alliedmods.net/showthread.php?t=333683)

1M1e 07-29-2021 04:10

Level + flag
 
hi,

can some one tell me whats the problem?

i want when some one got in level 40 he will get ADMIN_LEVEL_H

PHP Code:

#include <amxmisc>
#include <crxranks>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""new_round""a""1=0""2=0");
}

public 
new_round(id)
{
    if(
crxranks_get_user_level(id) >= 40)
    {
        
SetVipFlag(id)
    }

}

SetVipFlagid )
{
    
set_user_flagsidADMIN_LEVEL_H );



ConorCC 07-29-2021 05:57

Re: Level + flag
 
You cannot reach client_id directly from an event. You have to loop or something.

1M1e 07-29-2021 06:20

Re: Level + flag
 
and how i can do that?

Set_task ?

Natsheh 07-29-2021 07:30

Re: Level + flag
 
public crxranks_user_level_update(id, level, bool:levelup)

1M1e 07-29-2021 09:40

Re: Level + flag
 
Quote:

Originally Posted by Natsheh (Post 2753981)
public crxranks_user_level_update(id, level, bool:levelup)

Like this?

PHP Code:

#include <amxmisc>
#include <crxranks>
#include <zombie_escape>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}



public 
crxranks_user_level_updated(idtrue)
{
    if(
crxranks_get_user_level(id) >= 40)
    {
        
SetVipFlagid )
    }
    return 
PLUGIN_HANDLED
    
}

SetVipFlagid )
{
    
set_user_flagsidADMIN_LEVEL_H );


this way its only effect when the level of player updated and the player will lose his flag after the map change

i want when he in level 40 he will get admin level h

Natsheh 07-29-2021 11:45

Re: Level + flag
 
:arrow:
PHP Code:

public client_putinserver(id)
{
    if(
crxranks_get_user_level(id) >= 40)
    {
        
SetVipFlagid )
    }
}

public 
crxranks_user_level_updated(idlevelbool:levelup)
{
    if(
level >= 40)
    {
        
SetVipFlagid )
    }
    



The overrated maniac 07-29-2021 12:20

Re: Level + flag
 
PHP Code:


#include <amxmisc>
#include <crxranks>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)

register_event("HLTV""new_round""a""1=0""2=0");
}

public 
new_round(id)
{
if(
crxranks_get_user_level(id) >= 40)
{
SetVipFlag(id)
}

}

SetVipFlagid )
{
set_user_flagsidADMIN_LEVEL_H );
}

-------------------->

#include <amxmisc>
#include <crxranks>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define MAX_PLAYERS 32

public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)

register_event("HLTV""new_round""a""1=0""2=0");
}

public 
new_round(id)
{
for(new 
0i<MAX_PLAYERSi++){
if(
crxranks_get_user_level(i) >= 40 && is_user_connected(i))
{
SetVipFlag(i)
}
}
}

SetVipFlagid )
{
set_user_flagsidADMIN_LEVEL_H );



Natsheh 07-29-2021 12:28

Re: Level + flag
 
I wouldn't recommend using that.

1M1e 07-29-2021 12:37

Re: Level + flag
 
Quote:

Originally Posted by Natsheh (Post 2753999)
:arrow:
PHP Code:

public client_putinserver(id)
{
    if(
crxranks_get_user_level(id) >= 40)
    {
        
SetVipFlagid )
    }
}

public 
crxranks_user_level_updated(idlevelbool:levelup)
{
    if(
level >= 40)
    {
        
SetVipFlagid )
    }
    



dose not work

1M1e 07-29-2021 12:38

Re: Level + flag
 
Quote:

Originally Posted by Natsheh (Post 2754003)
I wouldn't recommend using that.

Why?


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

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