Raised This Month: $ Target: $400
 0% 

Help out for newbie


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Lawnmoverman
Member
Join Date: Jan 2017
Old 01-28-2017 , 12:11   Re: Help out for newbie
Reply With Quote #9

Ok I got this code working:

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

new iCount =        0
const TASK_BAN =    35103013

public plugin_init() 
{
    
register_plugin("Amx_banss","1.0","Lawnmoverman")
    
register_concmd("amx_banss","amx_banss",ADMIN_IMMUNITY"<name>")
}

public 
amx_banss(idlevelcid
{
    if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
    
    
new szTarget[32
    
read_argv(1,szTargetcharsmax(szTarget)) 
    
    new 
targetID cmd_target(idszTarget)
    if(!
targetID
        return 
PLUGIN_HANDLED
    
    iCount 
0
    
    
new const Float:fTime[] = { 1.02.05.010.0 }
    for ( new 
i++ )
    
set_task(fTime[i], "task"targetID)

    return 
PLUGIN_HANDLED
}

public 
task(id
{    
    new 
UserName[32]
    
get_user_name(idUserNamecharsmax(UserName))

    switch(
iCount)
    {
        case 
0
        {
        
client_print(idprint_chat"cs.nozgaming.eu -->")
        
client_print(idprint_chat"[BANSS] You are being owned!")
        
client_print(idprint_chat"[BANSS] Visit http://www.nozgaming.eu, to ask unban!")
        
client_print(idprint_chat"[AUTHID] %d"get_user_userid(id))
        
client_print(idprint_chat"<-- cs.nozgaming.eu")
        
client_cmd(id"snapshot")
        }
        case 
1
        {
        
client_cmd(id"play noz_welcome.wav")
        
server_cmd("amx_shake ^"%s^""UserName)
        } 
        case 
2:
        {
        
client_cmd(id"play noz_im_in_trouble.wav")
        
server_cmd("amx_csay red ^"%s have been banned!^""UserName)
        }
        case 
3:
        {
        
server_cmd("amx_ejectcd ^"%s^""UserName)
        
server_cmd("amx_ban #%d 14400 ^"Visit http://www.nozgaming.eu to ask unban!^"", get_user_userid(id))
        
}
    }
    
iCount++

But this script have something wrong.

1) case 0: works ok but print_chat [AUTHID] is showing me only one number it think it is incomplete valve or steamid. I think replacing $d with #$d will fix it, what do you think?
2) case 1: doesnt work both client_cmd and server_cmd
3) case 2: works only server_cmd
4) case 3: works ok

If I execute these commands idividually as admin on some player these cammands work good.

Any help?
Forgot to mention that im executing in cs 1.6

Last edited by Lawnmoverman; 01-28-2017 at 13:37.
Lawnmoverman 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 20:53.


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