Raised This Month: $ Target: $400
 0% 

Ban Player With Screenshot


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
The_Ghost
Senior Member
Join Date: Jun 2006
Location: RoMaNiA
Old 03-11-2007 , 14:22   Ban Player With Screenshot
Reply With Quote #1

Hey guys.. I have a problem... I edited the following plugin, because it was taking screenshot after the player was banned. Now it compiles, but when I ban somebody, on the picture the text doesn't appear Here's the code:

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


#define PLUGIN "Ban with Snapshot"
#define VERSION "0.3"
#define AUTHOR "SAMURAI"

 

new gBanData[33][2][32]

 

public 
plugin_init() {

        
register_plugin(PLUGINVERSIONAUTHOR)

       

        
register_concmd("amx_banss""cmdBanss"ADMIN_BAN"<name or #userid> <minutes> [reason]")

}

 

public 
cmdBanss(idlevelcid) {

        if (!
cmd_access(idlevelcid3))

                return 
PLUGIN_HANDLED

       

        
new target[32], minutes[8], reason[64]

       

        
read_argv(1target31)

        
read_argv(2minutes7)

        
read_argv(3reason63)

       

        new 
player cmd_target(idtarget9)

       

        if (!
player)

                return 
PLUGIN_HANDLED

       

        copy
(gBanData[player][0], 31minutes)

        
copy(gBanData[player][1], 31reason)

       

        new 
TaskData[4]

        
TaskData[0] = id

        TaskData
[1] = player

       


        set_task
(0.5"fnBanUser"0TaskData2)

       

        return 
PLUGIN_HANDLED

}

 

public 
fnBanUser(Data[]) {

        new 
id Data[0]

        new 
player Data[1]

       

        if (!
is_user_connected(id))

                return 
PLUGIN_HANDLED

       

        
new minutes[32], reason[32]

        
copy(minutes31gBanData[player][0])

        
copy(reason31gBanData[player][1])

       

        new 
authid[32], name2[32], authid2[32], name[32]

        new 
userid2 get_user_userid(player)

       

        
get_user_authid(playerauthid231)

        
get_user_authid(idauthid31)

        
get_user_name(playername231)

        
get_user_name(idname31)

               

        
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")"nameget_user_userid(id), authidname2userid2authid2minutesreason)

 

        new 
temp[64], banned[16], nNum str_to_num(minutes)

        if (
nNum)

                
format(temp63"%L"player"FOR_MIN"minutes)

        else

                
format(temp63"%L"player"PERM")

        
format(banned15"%L"player"BANNED")
    
       

        new 
timeS[32]
 
        
get_time("%m/%d/%Y - %H:%M:%S"timeS,31)
        
     
        new 
address[32]

        
get_user_ip(playeraddress311)

        new 
hostname[64]
        
get_cvar_string("hostname",hostname,63)
    
     new 
activity get_cvar_num("amx_show_activity")

        if (
activity != 0)

        {

                new 
players[32], pnummsg[256], len

                get_players
(playerspnum"c")

               

                for (new 
0pnumi++)

                {

                        
len format(msg255"%L"players[i], "ADMIN")

                       

                        if (
activity == 1)

                                
len += copy(msg[len], 255-len":")

                        else

                                
len += format(msg[len], 255-len" %s:"name)

                       

                        
len += format(msg[len], 255-len" %L"players[i], "BAN")

                        
len += format(msg[len], 255-len" %s "name2)

               

                        if (
nNum)

                               
format(msg[len], 255-len"%L"players[i], "FOR_MIN"minutes)

                        else

                                
format(msg[len], 255-len"%L"players[i], "PERM")

                       

                        
client_print(players[i], print_chat"%s"msg)

                }

        }

        
console_print(id"[AMXX] %L"id"CLIENT_BANNED"name2)

    
    
    
client_print(player,print_chat,"* Screenshot was made on : %s",hostname)
        
client_print(playerprint_chat"* Nick:  ^"%s^" with IP : %s",name2,address)
        
client_print(playerprint_chat"* Date : %s",timeS)
        
client_print(playerprint_chat"* Visit XXX for Unban.")

        
console_print(player,"* Screenshot was made on : %s",hostname)
        
console_print(player"* Nick:  ^"%s^" with IP : %s",name2,address)
        
console_print(player"* Date : %s",timeS)
        
console_print(player"* Visit XXX for Unban.")
        
client_cmd(player,"wait;snapshot;wait;snapshot")

        if (
reason[0])

                
server_cmd("kick #%d ^"%(%%s)^";wait;addip ^"%s^" ^"%s^";wait;writeip"userid2reasonbannedtempminutesaddress)

        else

                
server_cmd("kick #%d ^"%%s^";wait;addip ^"%s^" ^"%s^";wait;writeip"userid2bannedtempminutesaddress)

 

       

        return 
PLUGIN_HANDLED 
__________________
We live in a world where PIZZA arrives faster than the Police !

Last edited by The_Ghost; 03-11-2007 at 14:24.
The_Ghost is offline
Send a message via Skype™ to The_Ghost
 


Thread Tools
Display Modes

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 09:28.


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