Raised This Month: $32 Target: $400
 8% 

rules plugin for knife


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
barbergaming
Member
Join Date: Dec 2019
Location: Search For Me
Old 12-30-2019 , 01:35   rules plugin for knife
Reply With Quote #1

hello:can someone make this plugin for me

when u say /rules in the server u will got this msg

[name of server] Don't go 2v1, don't block, don't turn ur back or kill from behind, don't swear and bother! KICK/BAN

this rules works only in bridge and thanx <3
barbergaming is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-30-2019 , 06:16   Re: rules plugin for knife
Reply With Quote #2

Bridge?!
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 12-30-2019 , 07:18   Re: rules plugin for knife
Reply With Quote #3

I have 2 plugins for you! I use this plugins in my knife server... maybe will help you

Not need rules to prevent this

you can look here, server ip : 178.239.20.19:27015

This will block collesion!

Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <xs>
#include <engine>

new gOldTouch[33][33]
new Float:gDiff = 0.5 

#define VERSION "2.0"
#define FFADE_IN	 0x0000

new bool:Attack[33] = {true, ...} 
new bool:FORWARD[33] = false

new sz_MapName[32]

new Float:V[ 33 ][ 3 ];
new X_name[ 32 ];
new Y_name[ 32 ];


new cvar_push_enable;
new cvar_push_dist;
new cvar_push_force;
new cvar_push_angle;
new cvar_push_resp;
new cvar_push_slap;
new cvar_push_kill;
new cvar_push_strip;
new cvar_push_shoot;
new cvar_push_forward;
new cvar_forwardx;
new cvar_enable_spawn;
new gmsgScreenFade;

public plugin_init()
{
    register_plugin( "Anti-Block", VERSION, "raizo" );

    register_cvar("amx_attack_reset", "10.0")


    cvar_enable_spawn  =    register_cvar  ( "amx_enable_spawn", "0" );
    cvar_push_enable   =    register_cvar  ( "amx_push_enable", "1" );
    cvar_push_dist     =    register_cvar  ( "amx_push_distance", "50" );
    cvar_push_force    =    register_cvar  ( "amx_push_force", "-500");
    cvar_push_angle    =    register_cvar  ( "amx_push_angle", "90.0");
    cvar_push_resp     =    register_cvar  ( "amx_push_respawn", "0"); 
    cvar_push_slap     =    register_cvar  ( "amx_push_slap", "0");
    cvar_push_kill     =    register_cvar  ( "amx_push_kill", "0");
    cvar_push_strip    =    register_cvar  ( "amx_push_strip", "0");
    cvar_push_shoot    =    register_cvar  ( "amx_push_shoot", "0");
    cvar_push_forward  =    register_cvar  ( "amx_push_forward", "0");
    cvar_forwardx      =    register_cvar  ( "amx_forword_speed", "0.90");

    RegisterHam(Ham_TakeDamage, "player", "OnDamage", false);
    RegisterHam(Ham_TraceAttack, "player", "OnAttack");
    register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
    register_forward( FM_PlayerPreThink, "PlayerPreThink" );
    register_touch("player","player","fn_PlayerTouchPlayer");
    gmsgScreenFade = get_user_msgid("ScreenFade"); 
}

public plugin_precache( )
{
	precache_sound("AntiBlock/ToucheR.wav") 
        precache_sound("AntiBlock/ToucheD.wav") 
}

public client_connect(id){
    FORWARD[id] = false
}

public fwd_playerpostthink(id)
{
	static button; button = pev(id, pev_button)
	if(button & IN_FORWARD && FORWARD[id])
	{
		static flag; flag = pev(id, pev_flags)
		if(flag & FL_ONGROUND)
		{
			static Float:velocity[3]
			pev(id, pev_velocity, velocity)
			xs_vec_mul_scalar(velocity, get_pcvar_float(cvar_forwardx), velocity)
			set_pev(id, pev_velocity, velocity)
		}
	}
	return FMRES_IGNORED
}

public OnDamage(victim, inflictor, attacker, Float:dmg, dmgbits)
{
    if(!is_user_alive(attacker) || get_user_team(attacker) == get_user_team(victim))
        return HAM_IGNORED
    
    return Attack[attacker] ? HAM_IGNORED : HAM_SUPERCEDE
}

public OnAttack(ent, attacker, Float:damage, Float:direction[3], trace, dmgbits)
    return !Attack[attacker] ? HAM_SUPERCEDE : HAM_IGNORED


public touch( X, Y )
{      
    get_user_name( X, X_name, charsmax( X_name ) )
    get_user_name( Y, Y_name, charsmax( Y_name ) )
    
    velocity_by_aim( X, get_pcvar_num(cvar_push_force), V[ X ])

    message_begin(MSG_ONE, gmsgScreenFade, {0,0,0}, Y);
    write_short(2000); // Timer ex: 1000 = 1 sec
    write_short(2000); // Timer ex: 1000 = 1 sec
    write_short(FFADE_IN);
    write_byte(0); // Red 
    write_byte(0); // Green
    write_byte(255); // Blue
    write_byte(80); // Transperency
    message_end();

    message_begin(MSG_ONE, gmsgScreenFade, {0,0,0}, X);
    write_short(2000); // Timer ex: 1000 = 1 sec
    write_short(2000); // Timer ex: 1000 = 1 sec
    write_short(FFADE_IN);
    write_byte(255); // Red 
    write_byte(0); // Green
    write_byte(0); // Blue
    write_byte(80); // Transperency
    message_end();

    if(get_pcvar_num(cvar_push_resp)) 
    { 
        set_task(0.1, "RespawnToucheR", X) 
    }
    if(get_pcvar_num(cvar_push_slap))
    {
	user_slap(X, 0);
	user_slap(X, 0);
        user_slap(X, 0);
    }
    if(get_pcvar_num(cvar_push_kill)) 
    { 
        user_kill(X)
    }
    if(get_pcvar_num(cvar_push_strip)) 
    { 
        strip_user_weapons(X)
        set_task(10.0, "StripToucheR", X)
    }
    if(get_pcvar_num(cvar_push_shoot)) 
    { 
        Attack[X] = false
        set_user_rendering(X, kRenderFxGlowShell, 0, 255, 0, kRenderNormal)
        new Float:XYZ = get_cvar_float("amx_attack_reset")
        set_task(XYZ, "AttackAgain", X+2233)
    }
    if(get_pcvar_num(cvar_push_forward)) 
    { 
        set_task(10.0, "FORWARDMOVE", X)
        FORWARD[X] = true
    }

}

public FORWARDMOVE(XY)
{
    FORWARD[XY] = false
}

public AttackAgain(XY)
{
    XY -= 2233
    Attack[XY] = true
    set_user_rendering(XY) 
}

public RespawnToucheR(id) 
{ 
    ExecuteHamB(Ham_CS_RoundRespawn, id)   
} 

public StripToucheR(id)
{
    give_item(id, "weapon_knife") 
}

public PlayerPreThink( X )
{
    get_mapname( sz_MapName, charsmax( sz_MapName ) )
    
    if( containi( sz_MapName, "35hp" ) == 0 || containi( sz_MapName, "ka_" ) == 0 || containi( sz_MapName, "1hp" ) == 0)

    if( is_user_alive( X ), get_pcvar_num(cvar_push_enable))
    {
        if( V[ X ][ 0 ] != 0.0
            ||  V[ X ][ 1 ] != 0.0
            ||  V[ X ][ 2 ] != 0.0 )
        {
            set_pev( X, pev_velocity, V[ X ] );
            V[ X ][ 0 ] = 0.0;
            V[ X ][ 1 ] = 0.0;
            V[ X ][ 2 ] = 0.0;
        }
        
        static body_part_aimed
        
        static Float:X_A[ 3 ]
        static Float:Y_A[ 3 ]
        
        static Y
        static Float:Y_MIN_A
        static Float:Y_MAX_A
        
        get_user_aiming( X, Y, body_part_aimed, get_pcvar_num(cvar_push_dist))
        
        pev( X, pev_angles, X_A )
        pev( Y, pev_angles, Y_A )
        
        Y_MIN_A = Y_A[ 1 ] - get_pcvar_float(cvar_push_angle);
        Y_MAX_A = Y_A[ 1 ] + get_pcvar_float(cvar_push_angle);
        
        if( Y_MIN_A <= X_A[ 1 ] <= Y_MAX_A
            && is_user_alive( X )
            && is_user_alive( Y )
            && cs_get_user_team( X ) == cs_get_user_team( Y ) )
        {
            touch( X, Y ) // X_is_behind = true;
        }
    }
}
 
public fn_PlayerTouchPlayer(id_er,id_ed)
{
    static Float:X_A[ 3 ]
    static Float:Y_A[ 3 ]

    static Float:er_MIN_A
    static Float:ed_MAX_A

    if(get_pcvar_num(cvar_enable_spawn))
    {

        pev( id_er, pev_angles, X_A )
        pev( id_ed, pev_angles, Y_A )

        er_MIN_A = Y_A[ 1 ] - get_pcvar_float(cvar_push_angle);
        ed_MAX_A = Y_A[ 1 ] + get_pcvar_float(cvar_push_angle);

        if( er_MIN_A <= X_A[ 1 ] <= ed_MAX_A && is_user_alive( id_er ) && is_user_alive( id_ed ) && cs_get_user_team( id_er ) == cs_get_user_team( id_ed ) )
        {
            if(get_systime() - gOldTouch[id_er][id_ed] > gDiff || (get_systime() - gOldTouch[id_ed][id_er] > gDiff))
            {
                gOldTouch[id_er][id_ed] = get_systime()
                gOldTouch[id_ed][id_er] = get_systime()
         
                ExecuteHamB(Ham_CS_RoundRespawn, id_ed)

                return PLUGIN_CONTINUE
            }
        }
    }
    return PLUGIN_CONTINUE
}
This will block 2v1, 3v1

Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>

new gang_distance

public plugin_init() 
{     
    gang_distance = register_cvar( "amx_gang_distance", "100.0" );

    set_task( 0.1 , "FindPlayersTero" , .flags="b" );
    set_task( 0.1 , "FindPlayersCoun" , .flags="b" );
}


public FindPlayersTero()
{
    new iPlayers[ 32 ] , iNum , iPlayer , Float:fOrigin[ 3 ] , iEntity , iEnemyCount , szName[ 32 ];
    
    get_players( iPlayers , iNum , "ae" , "CT" );

    for ( new i = 0 ; i < iNum ; i++ )
    {
        iPlayer = iPlayers[ i ];
        
        pev( iPlayer , pev_origin , fOrigin );
        
        iEntity = -1;
        iEnemyCount = 0;
        
        while( ( iEntity = engfunc( EngFunc_FindEntityInSphere , iEntity , fOrigin , get_pcvar_float(gang_distance) ) ) != 0 )
        {
            if ( is_user_alive( iEntity ) && ( cs_get_user_team( iEntity ) == CS_TEAM_T ) )
                iEnemyCount++;
        }
        
        if ( iEnemyCount >= 2 )
        {
	   ExecuteHam(Ham_CS_RoundRespawn, iPlayer);
		
            get_user_name( iPlayer , szName , charsmax( szName ) );
            client_print( 0 , print_chat , "[Gang-Bang] %d Enemies VS %s" , iEnemyCount , szName );
        }
    }
}

public FindPlayersCoun()
{
    new iPlayers[ 32 ] , iNum , iPlayer , Float:fOrigin[ 3 ] , iEntity , iEnemyCount , szName[ 32 ];
    
    get_players( iPlayers , iNum , "ae" , "TERRORIST" );

    for ( new i = 0 ; i < iNum ; i++ )
    {
        iPlayer = iPlayers[ i ];
        
        pev( iPlayer , pev_origin , fOrigin );
        
        iEntity = -1;
        iEnemyCount = 0;
        
        while( ( iEntity = engfunc( EngFunc_FindEntityInSphere , iEntity , fOrigin , get_pcvar_float(gang_distance) ) ) != 0 )
        {
            if ( is_user_alive( iEntity ) && ( cs_get_user_team( iEntity ) == CS_TEAM_CT ) )
                iEnemyCount++;
        }
        
        if ( iEnemyCount >= 2 )
        {
	   ExecuteHam(Ham_CS_RoundRespawn, iPlayer);
		
            get_user_name( iPlayer , szName , charsmax( szName ) );
            client_print( 0 , print_chat , "[Gang-Bang] %d Enemies VS %s" , iEnemyCount , szName );
        }
    }
}

Last edited by raizo11; 12-30-2019 at 07:24.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-30-2019 , 08:30   Re: rules plugin for knife
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Bridge?!
He probably refers bridge to acer maps.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
barbergaming
Member
Join Date: Dec 2019
Location: Search For Me
Old 12-31-2019 , 05:48   Re: rules plugin for knife
Reply With Quote #5

i want to add knife skins to this plugin can u help me

Code:
#include <amxmodx>
#include <fvault>
#include <cstrike>
#include <wm_play>

#define maxranks 15
#define maxlevels 50

#define xPrefix "XP System"

#define RANKS_Noobest 0
#define RANKS_Noob 1
#define RANKS_Newbiee 2
#define RANKS_Easy 3
#define RANKS_Normal 4
#define RANKS_Hard 5
#define RANKS_Expert 6
#define RANKS_SuperExpert 7
#define RANKS_Specialist 8
#define RANKS_Leader 9
#define RANKS_Mayor 10
#define RANKS_Pro 11
#define RANKS_SuperPro 12
#define RANKS_Heroic 13
#define RANKS_God 14

new const VERSION[] =  "1.1"

new SzMaxPlayers, SzSayText;
new playerPrefix,rankLevelBonus,rankSaveType;

new const db_save[] = "cs_rank_system"

new level[33], xp[33], rank[33], g_status_sync

new SzGTeam[3][] = {
	"Spectator",
	"Terrorist",
	"Counter-Terrorist"
}

new const xp_num[maxlevels+1] = 
{ 
	15, 70, 150, 250, 350, 450, 550, 650, 750, 850, 950, 1050, 1150, 1250, 1350, 1450, 1550, 1650,
	1750, 1850, 1950, 2050, 2150, 2250, 2350, 2450, 2550,2650, 2750, 2850, 2950, 3050, 3150, 3250, 3350, 3450, 3550, 3650, 
	3750, 3850, 3950, 4050, 4150, 4250, 4350, 4450, 4550, 4650, 4750, 5000 
}

new const ranks_names[maxranks][]=
{
	"Noobest",
	"Noob",
	"Newbiee",
	"Easy",
	"Normal",
	"Hard",
	"Expert",
	"SuperExpert",
	"Specialist",
	"Leader",
	"Mayor",
	"Pro",
	"SuperPro",
	"Heroic",
	"God"
}

public plugin_init()
{
	register_plugin("XP + LEVEL + RANK SYSTEM", VERSION, AUTHOR)

	// system of xp+lvl+rank
	playerPrefix = register_cvar("Player Prefix", "1") //1-Prefix by RANK, 2-Prefix by LEVEL
	rankLevelBonus = register_cvar("Level Up Bonus", "10000") // Amount of money when passing level.
	rankSaveType = register_cvar("XP Save Type", "2") // 1 - IP || 2 - Nick || 3 - SteamID
	
	register_cvar("XPLvlRankSystem", VERSION, FCVAR_SERVER | FCVAR_SPONLY ) //Search for variable on Gametracker.com

	register_event("StatusValue", "showStatus", "be", "1=2", "2!0")
	register_event("StatusValue", "hideStatus", "be", "1=1", "2=0")
	
	register_clcmd("say", "hook_say");
	register_clcmd("say_team", "hook_say_team");
	
	register_dictionary("cs_rank_system.txt");

	SzSayText = get_user_msgid ("SayText");
	SzMaxPlayers = get_maxplayers();
	
	register_message(SzSayText, "MsgDuplicate");
	
	g_status_sync = CreateHudSyncObj()
}

/*----------------------------------------------------------------------------------------------------------------
-HUD OF THE GAME
----------------------------------------------------------------------------------------------------------------*/
public hud_status(id)
{
	if(!is_user_alive(id) ||  !is_user_connected(id) )
	return;
	if(level[id] >= maxlevels)
	{
		static r, g, b; r = random_num(0, 255), g = random_num(0, 255), b = random_num(0, 255);
		set_hudmessage(r, g, b, 0.80, -1.0, 0, 1.0, 1.1, 0.0, 0.0, -1)
		show_hudmessage(id,"» Level: %d/%d^n» Rank: %s^n» XP: %d/%d", level[id], maxlevels, ranks_names[rank[id]], xp[id], xp[id])
	}
	else
	{
		set_hudmessage(255, 255, 255, 0.80, -1.0, 0, 1.0, 1.1, 0.0, 0.0, -1)
		show_hudmessage(id,"» Level: %d/%d^n» Rank: %s^n» XP: %d/%d", level[id], maxlevels, ranks_names[rank[id]], xp[id], xp_num[level[id]])
	}
}

/*----------------------------------------------------------------------------------------------------------------
-CHAT PREFIX
----------------------------------------------------------------------------------------------------------------*/
public MsgDuplicate(id){ return PLUGIN_HANDLED; }

public hook_say(id)
{
	new SzMessages[192], SzName[32];
	new SzAlive = is_user_alive(id);
	
	read_args(SzMessages, 191);
	remove_quotes(SzMessages);
	get_user_name(id, SzName, 31);
	
	if(!is_valid_msg(SzMessages))
		return PLUGIN_CONTINUE;
	
	switch(get_pcvar_num(playerPrefix))
	{
		case 1 :(SzAlive ? format(SzMessages, 191, "^4[%s] ^3%s : ^1%s", ranks_names[rank[id]], SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^4[%s] ^3%s : ^1%s", ranks_names[rank[id]], SzName, SzMessages));
		case 2 :(SzAlive ? format(SzMessages, 191, "^4[Level %d] ^3%s : ^1%s", level[id], SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^4[Level %d] ^3%s : ^1%s", level[id], SzName, SzMessages));
	}
	
	for(new i = 1; i <= SzMaxPlayers; i++)
	{
		if(!is_user_connected(i))
			continue;
		
		message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, i);
		write_byte(id);
		write_string(SzMessages);
		message_end();
	}
	
	return PLUGIN_CONTINUE;
}

public hook_say_team(id)
{
	new SzMessages[192], SzName[32];
	new SzAlive = is_user_alive(id);
	new SzGetTeam = get_user_team(id);
	
	read_args(SzMessages, 191);
	remove_quotes(SzMessages);
	get_user_name(id, SzName, 31);
	
	if(!is_valid_msg(SzMessages))
		return PLUGIN_CONTINUE;
	
	switch(get_pcvar_num(playerPrefix))
	{
		case 1 : (SzAlive ? format(SzMessages, 191, "^1(%s) ^4[%s] ^3%s : ^1%s", SzGTeam[SzGetTeam], ranks_names[rank[id]], SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^1(%s) ^4[%s] ^3%s : ^1%s", SzGTeam[SzGetTeam], ranks_names[rank[id]], SzName, SzMessages));
		case 2 : (SzAlive ? format(SzMessages, 191, "^1(%s) ^4[Level %d] ^3%s : ^1%s", SzGTeam[SzGetTeam], level[id], SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^1(%s) ^4[Level %d] ^3%s : ^1%s", SzGTeam[SzGetTeam], level[id], SzName, SzMessages));
	}
		
	for(new i = 1; i <= SzMaxPlayers; i++)
	{
		if(!is_user_connected(i))
			continue;
		
		if(get_user_team(i) != SzGetTeam)
			continue;
		
		message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, i);
		write_byte(id);
		write_string(SzMessages);
		message_end();
	}
	
	return PLUGIN_CONTINUE;
}

bool:is_valid_msg(const SzMessages[])
{
	if( SzMessages[0] == '@'
	|| !strlen(SzMessages)){ return false; }
	return true;
}  

/*----------------------------------------------------------------------------------------------------------------
-EVENT TO ADD XP
----------------------------------------------------------------------------------------------------------------*/

public client_death(killer, victim, weapon, hitplace)
{
	new victim_name[32]
	get_user_name(victim, victim_name, charsmax(victim_name))
	
	new killer_team = get_user_team(killer)
	new victim_team = get_user_team(victim)
	
	//NORMAL KILL
	if((killer != victim) && !(killer_team == victim_team) && !(hitplace == HIT_HEAD) && !(weapon == CSW_HEGRENADE) && !(weapon == CSW_KNIFE))
	{
		xp[killer]++
		client_print_color(killer, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_NORMAL_KILL", victim_name)
	}
	
	//HEADSHOT
	if(hitplace == HIT_HEAD && !(weapon == CSW_KNIFE) && !(killer_team == victim_team))
	{
		xp[killer]+=3
		client_print_color(killer, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_HEADSHOT_KILL", victim_name)
	}
	
	//KNIFE KILL
	if(weapon == CSW_KNIFE && !(hitplace == HIT_HEAD) && !(killer_team == victim_team))
	{
		xp[killer]+=5
		client_print_color(killer, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_KNIFE_KILL", victim_name)
	}
	
	//KNIFE + HEADSHOT
	if(weapon == CSW_KNIFE && (hitplace == HIT_HEAD) && !(killer_team == victim_team))
	{
		xp[killer]+=7
		client_print_color(killer, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_KNIFE_HEAD_KILL", victim_name)
	}
	
	//GRENADE KILL
	if(weapon == CSW_HEGRENADE && (killer != victim) && !(killer_team == victim_team))
	{
		xp[killer]+=5
		client_print_color(killer, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_GRENADE_KILL", victim_name)
	}
	
	//SUICIDE
	if(killer == victim)
	{
		xp[killer]-=2
		client_print_color(killer, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_SUICIDE")
	}
	
	//TEAM KILL
	if(killer != victim && (killer_team == victim_team))
	{
		xp[killer]-=10
		client_print_color(killer, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_TEAM_KILL")
	}
	
	check_level(killer, 1)
	save_data(killer)
}
	

/*----------------------------------------------------------------------------------------------------------------
-CHECK LEVEL OF ADD ++
----------------------------------------------------------------------------------------------------------------*/
public check_level(id, sound)
{
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;
	
	new name[32]; get_user_name(id, name, 31)
	
	if(level[id] < maxlevels) 
	{		
		while(xp[id] >= xp_num[level[id]])
		{
			level[id]++
			
			if(sound)
			{
				if(level[id] == maxlevels)
				{
					client_print_color(id, "!g[%s] %L", xPrefix, LANG_PLAYER, "MSG_MAXLVL_ID", level[id])
					client_print_color(0, "!g[%s] %L",xPrefix, LANG_PLAYER, "MSG_MAXLVL_ALL", name, level[id])
					
					client_cmd(0, "spk ambience/wolfhowl02.wav")
					
					return PLUGIN_HANDLED
				}
				
				client_print_color(id,"!g[%s] %L",xPrefix,LANG_PLAYER, "MSG_RAISE_LEVEL_ID", get_pcvar_num(rankLevelBonus))
				client_print_color(0, "!g[%s] %L",xPrefix,LANG_PLAYER, "MSG_RAISE_LEVEL_ALL", name, get_pcvar_num(rankLevelBonus))
				cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num(rankLevelBonus))
				
				client_cmd(0, "spk ambience/lv_fruit1.wav")
				
				set_ranks(id)
			}
		}
	} 
	
	// Bug Preventions... (Back to top)
	if(level[id] == maxlevels && xp[id] > xp_num[level[id]-1])
	{
		xp[id] = xp_num[level[id]-1]
		save_data(id)
	}
	
	if(level[id] >= maxlevels) 
	{	
		level[id] = maxlevels
		xp[id] = xp_num[level[id]-1]
		save_data(id)
	}
	
	return PLUGIN_HANDLED
}

/*----------------------------------------------------------------------------------------------------------------
-SET THE RANK POSITION
----------------------------------------------------------------------------------------------------------------*/
public set_ranks(id)
{
	if(level[id] <= 2) rank[id] = RANKS_Noobest
	if(level[id] >= 2) rank[id] = RANKS_Noob
	if(level[id] >= 5) rank[id] = RANKS_Newbiee
	if(level[id] >= 8) rank[id] = RANKS_Easy
	if(level[id] >= 11) rank[id] = RANKS_Normal
	if(level[id] >= 14) rank[id] = RANKS_Hard
	if(level[id] >= 17) rank[id] = RANKS_Expert
	if(level[id] >= 20) rank[id] = RANKS_SuperExpert
	if(level[id] >= 23) rank[id] = RANKS_Specialist
	if(level[id] >= 26) rank[id] = RANKS_Leader
	if(level[id] >= 29) rank[id] = RANKS_Mayor
	if(level[id] >= 32) rank[id] = RANKS_Pro
	if(level[id] >= 33) rank[id] = RANKS_SuperPro
	if(level[id] >= 36) rank[id] = RANKS_Heroic
	if(level[id] >= 43) rank[id] = RANKS_God
}

/*----------------------------------------------------------------------------------------------------------------
-SAVE LEVEL, XP AND RANK
----------------------------------------------------------------------------------------------------------------*/
public save_data(id)
{
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;
	
	new auth[40], data[50]
	
	switch(get_pcvar_num(rankSaveType))
	{
		case 1: get_user_ip(id, auth, charsmax(auth), 1)
		case 2: get_user_name(id, auth, charsmax(auth))
		case 3: get_user_authid(id, auth, charsmax(auth))
	}
	
	formatex(data, charsmax(data), "%d %d", level[id], xp[id])
	
	fvault_pset_data(db_save, auth, data)
	
	return PLUGIN_HANDLED;
}

/*----------------------------------------------------------------------------------------------------------------
-LOAD DATA
----------------------------------------------------------------------------------------------------------------*/

public client_authorized(id)
{
	new auth[40], data[50], x1[10], x2[10]
	
	switch(get_pcvar_num(rankSaveType))
	{
		case 1: get_user_ip(id, auth, charsmax(auth), 1)
		case 2: get_user_name(id, auth, charsmax(auth))
		case 3: get_user_authid(id, auth, charsmax(auth))
	}
	
	fvault_get_data(db_save, auth, data, charsmax(data))
	parse(data, x1, charsmax(x1), x2, charsmax(x2))
	
	level[id] = str_to_num(x1)
	xp[id] = str_to_num(x2)
	
	set_task(2.0, "set_ranks", id)
	check_level(id, 0)
	
	set_task(1.1, "hud_status", id, _, _, "b")
}

/*----------------------------------------------------------------------------------------------------------------
-SHOW XP BY LOOKING AT THE PERSON
----------------------------------------------------------------------------------------------------------------*/

public showStatus(id)
{
	if(!is_user_bot(id) && is_user_connected(id)) 
	{
		new name[32], pid = read_data(2)
		
		get_user_name(pid, name, 31)
		
		new xxx = get_user_team(id)
		new xxx2 = get_user_team(pid)
		
		static r, g, b;
		r = random_num(0, 255), g = random_num(0, 255), b = random_num(0, 255);
		
		if (xxx == xxx2)    // friend
		{
			set_hudmessage(r, g, b, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1)
			ShowSyncHudMsg(id, g_status_sync, "Name: %s^nRank: %s^nLevel: %d^nXP: %d/%d", name, ranks_names[rank[pid]], level[pid], xp[pid], xp_num[level[pid]])
		}
	}
}

public hideStatus(id)
{
	ClearSyncHud(id, g_status_sync)
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang16393\\ f0\\ fs16 \n\\ par }
*/
barbergaming is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-31-2019 , 08:33   Re: rules plugin for knife
Reply With Quote #6

A much beter option is for you to use these 2 plugins that have XP + knife skins support and are 100x times better coded:

https://forums.alliedmods.net/showthread.php?t=308540
https://forums.alliedmods.net/showthread.php?t=293632
__________________

Last edited by OciXCrom; 12-31-2019 at 08:33.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
barbergaming
Member
Join Date: Dec 2019
Location: Search For Me
Old 12-31-2019 , 14:56   Re: rules plugin for knife
Reply With Quote #7

OciXCrom your all sma files dont want to complie lol
barbergaming is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-01-2020 , 03:26   Re: rules plugin for knife
Reply With Quote #8

must to add inc files in addons/amxmodx/scripting/include
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
barbergaming
Member
Join Date: Dec 2019
Location: Search For Me
Old 01-01-2020 , 05:50   Re: rules plugin for knife
Reply With Quote #9

bro i complie sma files onlone bcs my complie exe dont work its refrech all sma files and auto exit idk why btw raizo can i get your fb i need some notice from you "sorry for band eng" <3
barbergaming is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-01-2020 , 08:58   Re: rules plugin for knife
Reply With Quote #10

Quote:
Originally Posted by barbergaming View Post
OciXCrom your all sma files dont want to complie lol
Lol so funny. You can't use an online compiler that doesn't support custom .inc files. Compile your plugins LOCALLY.



It's 2020, learn how to compile your plugins already.
The only reason for your compile.exe not to work is if you downloaded AMXX from some crap website. AMXX has an official website, so USE IT.
__________________

Last edited by OciXCrom; 01-01-2020 at 09:00.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 15:31.


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