Raised This Month: $ Target: $400
 0% 

transfer plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
giumbalau
Member
Join Date: Jan 2021
Old 06-15-2021 , 14:46   transfer plugin
Reply With Quote #1

I was trying to limit the commands because the players are abusing of them but i am doing something wrong can anyone fix it ?

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike > 

new g_movelimit

public plugin_init()
{
       
register_plugin("Players transfer""1.9.0.5271""")

       
register_clcmd("say /spec","spec")
       
register_clcmd("say_team /spec","spec")
       
register_clcmd("say /ct","ct")
       
register_clcmd("say_team /ct","ct")
       
register_clcmd("say /t","t")
       
register_clcmd("say_team /t","t")

       
g_movelimit register_cvar("move_limit""3")
}
 
public 
spec(id)
{     
       if(
get_pcvar_num(g_movelimit))
       {
       
color_chat(id"^4%s^3 This command can be used only^4 3 times per map")
       return 
PLUGIN_HANDLED
       
}    
 
       
cs_set_user_team(id,CS_TEAM_SPECTATOR)

       if(
is_user_alive(id))
       
user_silentkill(id)

       return 
PLUGIN_HANDLED     
}

public 
ct(id)
{
       
cs_set_user_team(id,CS_TEAM_CT)
       
user_silentkill(id)

       return 
PLUGIN_HANDLED
}

public 
t(id)
{
       
cs_set_user_team(id,CS_TEAM_T)
       
user_silentkill(id)

       return 
PLUGIN_HANDLED
}

stock color_chat(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4"); // Green Color
    
replace_all(msg190"!y""^1"); // Default Color
    
replace_all(msg190"!team""^3"); // Team Color
    
replace_all(msg190"!team2""^0"); // Team2 Color
        
    
if (idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

giumbalau is offline
 



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 19:54.


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