AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ban users for freekilling (https://forums.alliedmods.net/showthread.php?t=107910)

izzle 10-31-2009 19:55

Ban users for freekilling
 
I made a plugin where cts can glow terrorists to give them freedays for jailbreak, but I want to make it so it can only be used 2 times every 7 rounds or it will ban the user for 15 mins

Doc-Holiday 10-31-2009 21:53

Re: Ban users for freekilling
 
Quote:

Originally Posted by izzle (Post 977185)
I made a plugin where cts can glow terrorists to give them freedays for jailbreak, but I want to make it so it can only be used 2 times every 7 rounds or it will ban the user for 15 mins


code?

DruGzOG 10-31-2009 21:54

Re: Ban users for freekilling
 
Quote:

Originally Posted by NcB_Sav (Post 977277)
code?

new plugin submissions.

izzle 10-31-2009 22:01

Re: Ban users for freekilling
 
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>

new g_iMaxPlayers

public plugin_init()
{
    
register_plugin("JailBreak Glow Menu""1.1""izzle")
    
register_clcmd"say /glow","JBGlowMenu");
    
register_clcmd"say_team /glow","JBGlowMenu");
}
public 
event_round_start()
{
    for (new 
idid <= g_iMaxPlayersid++)
    {    
        
fm_set_rendering(idkRenderFxGlowShell000kRenderNormal20)
    }
    
}
public 
JBGlowMenu(id)
{
    if (
cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id))
    { 
        return 
PLUGIN_HANDLED;
    }
    new 
menu menu_create("\rJB Glow Menu:""sub_menu");
    
    new 
players[32], pnumtempid;
    new 
szName[32], szTempid[10];
    
    
get_players(playerspnum"a");
    
    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        if (
cs_get_user_team(tempid) != CS_TEAM_T)
        {
            continue;
        }
        
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
        
menu_additem(menuszNameszTempid0);
    }
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
sub_menu(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
tempid str_to_num(data);
    new 
szName[32], szName2[32];
    
get_user_name(idszName31);
    
get_user_name(tempidszName231);
    
fm_set_rendering(tempidkRenderFxGlowShell2551400kRenderNormal20)
    
set_hudmessage(02550)
    
show_hudmessage(0"[JBGM] %s gave a freeday to %s^n and is now glowing!"szNameszName2);
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 


Doc-Holiday 10-31-2009 22:03

Re: Ban users for freekilling
 
Why ban theplayer though

Just add a check

PHP Code:

if(glowlimit[id] <= 7)
{
   
//do the glow thingy
}
else
{
  
//Dont do it and say YOU USED IT ALL UP



izzle 10-31-2009 22:08

Re: Ban users for freekilling
 
Quote:

Originally Posted by NcB_Sav (Post 977288)
Why ban theplayer though

Just add a check

PHP Code:

if(glowlimit[id] <= 7)
{
   
//do the glow thingy
}
else
{
  
//Dont do it and say YOU USED IT ALL UP



I want to ban them because I dont wan't them to freekill.

Doc-Holiday 10-31-2009 22:23

Re: Ban users for freekilling
 
Quote:

Originally Posted by izzle (Post 977295)
I want to ban them because I dont wan't them to freekill.


Right but if you do a check for 7 glows....

It will stop them after 7 kills

izzle 10-31-2009 22:25

Re: Ban users for freekilling
 
Quote:

Originally Posted by NcB_Sav (Post 977309)
Right but if you do a check for 7 glows....

It will stop them after 7 kills

But it doesn't matter if they can't use the menu anymore, they can still freekill, thats why I wanted to ban them :|

Doc-Holiday 10-31-2009 22:26

Re: Ban users for freekilling
 
Quote:

Originally Posted by izzle (Post 977312)
But it doesn't matter if they can't use the menu anymore, they can still freekill, thats why I wanted to ban them :|


Ok well do the check if more then 7 the

ban (user) type ... but use that type of check


glowlimit[32]


then every time they use it ++glowlimit[id]

if(glowlimit[id] >= 7)
{
ban

}

izzle 10-31-2009 22:27

Re: Ban users for freekilling
 
Quote:

Originally Posted by NcB_Sav (Post 977315)
Ok well do the check if more then 7 the

ban (user) type ... but use that type of check


glowlimit[32]


then every time they use it ++glowlimit[id]

if(glowlimit[id] >= 7)
{
ban

}

Ok but I want it to ban them if they use it more than 2 times in 7 rounds


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

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