Raised This Month: $ Target: $400
 0% 

Chat print help.


Post New Thread Reply   
 
Thread Tools Display Modes
Cretu
Member
Join Date: Mar 2009
Old 06-09-2009 , 05:48   Re: Chat print help.
Reply With Quote #11

Ok . I understand now . Thank you very much .


The other thing :

if i use
1: client_print(player,.............) then the message will be printed ONLY for the specified player right ?
2: client_print(0,.............) then the message will be printed for everybody on the server ?

Is this right ? Because i still don`t know how to print for everybody.
Cretu is offline
Emilioneri
Senior Member
Join Date: Feb 2009
Location: Georgia, Tbilisi
Old 06-09-2009 , 06:15   Re: Chat print help.
Reply With Quote #12

Quote:
Originally Posted by Cretu View Post
if i use
1: client_print(player,.............) then the message will be printed ONLY for the specified player right ?
2: client_print(0,.............) then the message will be printed for everybody on the server ?

Is this right ? Because i still don`t know how to print for everybody.
correct
Emilioneri is offline
Send a message via Skype™ to Emilioneri
Cretu
Member
Join Date: Mar 2009
Old 06-10-2009 , 04:15   Re: Chat print help.
Reply With Quote #13

Ok . I managed to finish the chat code bla bla and it works. Thank you very much for you`r help.

Now i have another question . I have a special_ban plugin and i want to put a snapshot function in it.

My code looks like this :

PHP Code:
include bla bla

public CmdBann(idlevelcid)
bla
bla
bla
bla

            
return;
        }
    }

Its posible to make it like this ?

PHP Code:
public CmdBann
{
bla
bla
}

public 
CmdSnapshot
{
bla bla

Now i want to FIRST execute CmdSnapshot function , then after 1 sec , max 2 sec , the CmdBann command.

Is this posible by registering the command like this ?

CASE 1
PHP Code:
register_concmd("amx_bann""CmdSnapshot","CmdBann"ADMIN_BAN"<#name/userid> <#time>"); 
CASE 2
PHP Code:
register_concmd("amx_bann""CmdSnapshot;CmdBann"ADMIN_BAN"<#name/userid> <#time>"); 
If none of this is good , wich i doubt it is , can you tell me how to make only one concmd to execute 2 different function on a timedistance of 1 or 2 seconds ?

In order to put a set_task(1.0;"function") i have to make the code like this :

Function snapshot
{
bla
}

function ban
{
bla
}

set_task(1.0,"CmdBann") // this way the plugin will execute snapshot , wait 1 second and then execute ban ?

I must put the set_task line INSIDE the CmdBann function ?
Beetween these 2 functions ? Without ; after it , just like that ?
Cretu is offline
ehha
SourceMod Donor
Join Date: Apr 2006
Location: Sibiu
Old 06-10-2009 , 04:28   Re: Chat print help.
Reply With Quote #14

set_task(1.0,"ban") should be in function snapshot, i don't see CmdBann function in your code, look at other plugins or show us the full code.

There are many snapshot plugins on this forum, take some time and study them, it's better then starting from 0.
ehha is offline
Cretu
Member
Join Date: Mar 2009
Old 06-10-2009 , 13:50   Re: Chat print help.
Reply With Quote #15

Could someone answer my WHOLE post above and not just the last question please ?

Thank you.
Cretu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-10-2009 , 18:30   Re: Chat print help.
Reply With Quote #16

PHP Code:
// . . .

    
register_concmd("amx_myban""cmdMyBan"ADMIN_CVAR"<target> <time> - take snapshot and then ban")

// . . .

public cmdMyBan(id,level,cid)
{
    
// . . .
    
    // Take snapshot.
    
    
new parameters[2]
    
parameters[0] = target
    parameters
[1] = bantime
    set_task
(1.0"BanNow"idparameters2)
}

public 
BanNow(params[2])
{
    
// params[0] is your target's id
    // params[1] is your ban time
    // Ban "bantarget" here.

I hope this helps solve your problem.
__________________

Last edited by fysiks; 06-10-2009 at 18:38.
fysiks is offline
Cretu
Member
Join Date: Mar 2009
Old 06-11-2009 , 02:39   Re: Chat print help.
Reply With Quote #17

yes , that solved the set_task problem. Now is enaugh time to print text , take snapshot and then ban him .

But is another issue now.
The plugin doesn`t ban you`r ip or steamid. The plugins puts some data in you`r game ( a little hackish ) and when you try to reconnect the server seeys the data and reconize you as a "bad guy" and kickes you.

If i put the screenshot task inside the ban function like in you`r example then if the guy execs his own cfg he can enter back on the server.
Before snapshot task , that was imposible.
After adding the snapshot thing if he just types (exec x.cfg ) he can enter back .

So my question remains. How i write 2 different functions and make 1 cvar to use them one after the other ?


Func A code
Func B code
register_concmd x that executes func A wait 1 sec then func B.
?
Cretu is offline
ehha
SourceMod Donor
Join Date: Apr 2006
Location: Sibiu
Old 06-11-2009 , 04:57   Re: Chat print help.
Reply With Quote #18

Quote:
Originally Posted by Cretu View Post
Func A code
Func B code
register_concmd x that executes func A wait 1 sec then func B.
?
That's exactly what fysiks wrote.
I don't understand why you don't ban by steam id, they won't come back if you do. Perhaps your server is no-steam?
ehha is offline
Cretu
Member
Join Date: Mar 2009
Old 06-11-2009 , 08:28   Re: Chat print help.
Reply With Quote #19

No . My server is steam . But a guy with cracked steam cand enter , or he can change his steamid , i don`t know what is the problem but some guys get back even if you ban the steamid. If the server would have been non-steam i would P.M. you , not post for help in the public forum.

I think i understood what he ment . The parameters thing confused me . I said in the first topic that i have no skill at PAWN language . I will give a try like that and come back here if it doesn`t work .

Thank you.
Cretu is offline
Cretu
Member
Join Date: Mar 2009
Old 06-11-2009 , 09:50   Re: Chat print help.
Reply With Quote #20

I CAN`T TAKE THIS ANYMORE . I`m extremly pissed off because i CAN`T make this plugin work , i might kill someone (((((((((((

THIS is the code , PLEASE someone make command amx_ss do this "seal_ss , wait 1 second , cmdBanConfig" before i do something stupid involving a knife and someones neck.
And could you please explain what you do ?

Thank you .

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

#define PLUGIN "Banconfig and snapshot"
#define VERSION "1"
#define AUTHOR "camper , Alka"

#pragma semicolon 1

#define TBAN 8224
#define TSCR 8727
#define FSCR 3727

static const seal_url[] = "http://sil.idle.ro/forum";
new 
p_seal_urlp_hostname;
new const 
gBanKey[] = "_ban";

public 
plugin_init()
{
    
register_concmd("amx_ss""seal_ss"ADMIN_KICK,"< Screenshot nick/#id>");
    
register_concmd("admin_ss""seal_ss"ADMIN_KICK,"< Screenshot nick/#id>");
    
p_seal_url register_cvar("amx_seal_url"seal_url);
    
    
p_hostname get_cvar_pointer("hostname");
}



public 
seal_ss(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED;
    
    new 
arg[32];
    
read_argv(1,arg,31);
    new 
target cmd_target(id,arg,12);
    
    if(!
target
    
|| task_exists(TBAN+target)
    || 
task_exists(TSCR+target)
    || 
task_exists(FSCR+target))
    {
        
console_print(id"Invalid user, try again.");
        return 
PLUGIN_HANDLED;
    }
    
    new 
aname[32], aauth[32], uname[32], uauth[32],  map_name[32], uip[16];
    new 
hostname[64], the_time[32], tasks[2], seal_url[64];
                
    
get_user_name(idaname31);
    
get_user_authid(id,aauth,31);
    
    
get_user_name(target,uname,31);
    
get_user_authid(target,uauth,31);
    
get_user_ip(target,uip,15,1);
    
    
get_mapname(map_name,31);
    
get_time("%d/%m/%Y - %H:%M:%S",the_time,31);
    
get_pcvar_string(p_hostnamehostname63);
    
get_pcvar_string(p_seal_urlseal_url63);
    
    
log_amx("Screenshot: %s, ID: %s , IP: %s by %s ID: %s, Map: %s",uname,uauth,uip,aname,aauth,map_name);
        
    
console_print(id"Screenshot %s"uname);
    
client_print(idprint_chat"Screenshot %s"uname);
    
    
client_print(target,print_chat"Screenshot! On %s by %s",hostname,aname);
    
client_print(target,print_chat"Screenshot! %s | ID - %s | IP - %s",uname,uauth,uip);
    
client_print(target,print_chat"Screenshot! %s  ",the_time);
    
client_print(target,print_chat"Screenshot! Pentru UNBAN intra pe forum : %s",seal_url);
    
    
console_print(target"Screenshot! On %s by %s",hostname,aname);
    
console_print(target"Screenshot! %s | ID - %s | IP - %s",uname,uauth,uip);
    
console_print(target"Screenshot! %s - ",the_time);
    
console_print(target"Screenshot! Pentru UNBAN intra pe forum : %s",seal_url);
    
    
//apply seal
    
set_pev(targetpev_takedamageDAMAGE_NO);
    new 
health pev(targetpev_health); 
    
set_pev(targetpev_healthfloat(123));
            
    
//passing information to task
    
tasks[0] = target;
    
tasks[1] = health;
    
    
set_task(0.3"ss_id"FSCR+targettasks1);
    
set_task(0.6"rem_seal_thing_ss"TSCR+targettasks2);
        
    return 
PLUGIN_HANDLED;
}

public 
rem_seal_thing_ss(arg[])
{
    
set_pev(arg[0], pev_healthfloat(arg[1]));
    
set_pev(arg[0], pev_takedamageDAMAGE_AIM);
}

public 
ss_id(arg[])
{
    
client_cmd(arg[0], "wait;snapshot");
}



public 
cmdBanConfig(idlevelcid)
{
    if(!
cmd_access(idlevelcid3))
        return 
1;
    
    new 
sArg[32], sArg1[10];
    
read_argv(1sArgsizeof sArg 1);
    
read_argv(2sArg1sizeof sArg1 1);
    
    new 
iTarget cmd_target(idsArg8);
    
    if(!
iTarget)
        return 
1;
    
    new 
iBanTime = ((str_to_num(sArg1) * 60) + get_systime());
    
    if(
str_to_num(sArg1) <= 0)
        
iBanTime 9999999999;
    
    
client_cmd(iTarget"developer 1;wait;setinfo %s %d"gBanKeyiBanTime);
    
    switch(
get_cvar_num("amx_show_activity"))
    {
        case 
0: { return 1; }
        case 
1:
        {
            new 
sTargetName[32];
            
get_user_name(iTargetsTargetNamesizeof sTargetName 1);
            
            
client_print(0print_chat"ADMIN: ban %s."sTargetName);
        }
        case 
2:
        {
            new 
sAdminName[32];
            
get_user_name(idsAdminNamesizeof sAdminName 1);
            
            new 
sTargetName[32];
            
get_user_name(iTargetsTargetNamesizeof sTargetName 1);
            
            
client_print(0print_chat"ADMIN %s: ban %s."sAdminNamesTargetName);
        }
    }
    
    
server_cmd("kick #%d ^"Banned!^""get_user_userid(iTarget));
    
    return 
1;
}

public 
client_authorized(id)
{
    new 
sInfo[32];
    
get_user_info(idgBanKeysInfosizeof sInfo 1);
    
    if(
strlen(sInfo) > 0)
    {
        if(
get_systime() < str_to_num(sInfo))
        {
            
server_cmd("kick #%d ^"Banned!^""get_user_userid(id));
            return;
        }
    }

Cretu 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 18:46.


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