Raised This Month: $51 Target: $400
 12% 

Loops ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 09-03-2010 , 09:36   Loops ?
Reply With Quote #1

Hi, I want something a little code:
If the user for a time, write "test" on say, shows "Do not write that," the two together to get a kick, and the three together to get a ban. Is such a code exists?
If so, please, for example a plugin or a small tutorial. Thanks for all the speeches and I apologize for my poor english, because I use the translator.
hh2 is offline
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 09-04-2010 , 13:37   Re: Loops ?
Reply With Quote #2

Refresh
hh2 is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 09-04-2010 , 13:53   Re: Loops ?
Reply With Quote #3

Code:
#include <amxmodx> new Amount[33] public plugin_init() {     register_plugin( "Test Amount", "1.0", "Wrecked" )         register_clcmd( "say test", "CmdTest" ) } public client_putinserver( id )     Amount[id] = 0 public CmdTest( id )     Amount[id]++     // Amount[index] holds the number of times index has said test
That is how you store the number of times test has been said individually. Do with that what you wish.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 09-04-2010 at 14:11.
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-04-2010 , 13:55   Re: Loops ?
Reply With Quote #4

Don't forget to reset it when a user enters the server.

PHP Code:
public client_putinserverid )
{
    
Amount[id] = 0

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 09-04-2010 , 14:11   Re: Loops ?
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Don't forget to reset it when a user enters the server.

PHP Code:
public client_putinserverid )
{
    
Amount[id] = 0

Added.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-04-2010 , 14:20   Re: Loops ?
Reply With Quote #6

{ and } are completely free, you don't need ant money to use them.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 09-04-2010 , 14:25   Re: Loops ?
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
{ and } are completely free, you don't need ant money to use them.
That's just my coding style. Everyone has their styles and I like to drop the brackets when available.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 09-04-2010 , 14:42   Re: Loops ?
Reply With Quote #8

I tried, but still not working, where is the error?
PHP Code:
#include <amxmodx>

new Amount[33]

public 
plugin_init()
{
    
register_plugin("Test Amount","1.0","Wrecked")
    
    
register_clcmd("say test","CmdTest")
}

public 
client_putinserver(id)
{
    
Amount[id] = 0
}  

public 
CmdTest(id)
{
    
Amount[id]++
    
    new 
name[32];
    
get_user_name(idname32);
    
    if ( 
Amount[1] )
    {
        
client_print(idprint_center"Dont say test !");
    }
    
    if ( 
Amount[2] )
    {
        
server_cmd("amx_slay %s",name); 
    }
    
    if ( 
Amount[3] )
    {
        
server_cmd("amx_ban %s 2",name);
    }

hh2 is offline
eNz0
Member
Join Date: Feb 2010
Location: Lithuania
Old 09-04-2010 , 15:04   Re: Loops ?
Reply With Quote #9

Amount[1] should be Amount[id] == 1


eNz0 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-04-2010 , 15:16   Re: Loops ?
Reply With Quote #10

PHP Code:
public CmdTest(id)
{
    switch( ++
Amount[id] )
    {
        case 
1:
        {
            
client_print(idprint_center"Dont say test !");
        }
        case 
2:
        {
            
user_kill(id)
        }
        default:
        {
            
server_cmd("amx_ban #%d 2"get_user_userid(id))
        }
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
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 02:47.


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