AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   server_cmd message without " (https://forums.alliedmods.net/showthread.php?t=183860)

tcPane 04-27-2012 17:00

server_cmd message without "
 
how to remove " in server_cmd

i use this code, but it put " in front of and behind message

server_cmd("kick #%d ^"You were kicked for being AFK longer than 45 seconds^"")

i want normal message in cmd ( without "" )

<VeCo> 04-27-2012 17:09

Re: server_cmd message without "
 
Can you explain more?

.Dare Devil. 04-27-2012 17:15

Re: server_cmd message without "
 
That is how pawn language system works, you can not change it.

claudiuhks 04-27-2012 19:08

Re: server_cmd message without "
 
Quote:

Originally Posted by tcPane (Post 1697656)
how to remove " in server_cmd

i use this code, but it put " in front of and behind message

server_cmd("kick #%d ^"You were kicked for being AFK longer than 45 seconds^"")

i want normal message in cmd ( without "" )

PHP Code:

server_cmd"kick #%d  You've been kicked out!"get_user_useridiPlayer ) ); 


tcPane 04-28-2012 04:53

Re: server_cmd message without "
 
Quote:

Originally Posted by claudiuhks (Post 1697722)
PHP Code:

server_cmd"kick #%d  You've been kicked out!"get_user_useridiPlayer ) ); 


Works, Thanks.
I want to make some changes. There is some bugs in this code. Can someone fix this code?

PHP Code:

#include <amxmodx>

const TASK_CHECK 2707

#define WARNING_TIME 30
#define MIN_AFK_TIME 35
#define CHECK_MESSAGE 5

new g_jointime[33]

public 
plugin_init() 
{
    
register_clcmd("joinclass""cmdJoinClass")
    
register_cvar("mp_jointime""120")
    
    
set_task(float(CHECK_MESSAGE),"Task_Check",_,_,_,"b")
}

public 
client_putinserver(id)
{
    new 
start get_cvar_num("mp_jointime")
    
set_task(start"Task_Check"id+TASK_CHECK)
}

public 
cmdJoinClass(id)
    
remove_task(id+TASK_CHECK)
    
public 
Task_Check(taskid)
{
    new 
maxjointime get_cvar_num("mp_jointime")
    
    if(
maxjointime MIN_AFK_TIME
    {
        
log_amx("cvar mp_jointime %i is too low. Minimum value is %i."maxjointimeMIN_AFK_TIME)
        
maxjointime MIN_AFK_TIME
        set_cvar_num
("mp_jointime"MIN_AFK_TIME)
    }
        
    if(
maxjointime-WARNING_TIME <= g_jointime[taskid] < maxjointime
    {
        new 
timeleft maxjointime g_jointime[taskid]
        
client_print(taskidprint_chat"You have %i seconds to join a team or you will be kicked."timeleft)
    } 
    else if (
g_jointime[taskid] > maxjointime
    {
        
//new name[32]
        //get_user_name(id, name, 31)
        //client_print(0, print_chat, "%s was kicked for failure to join a team within 2 minutes.", name)
        //log_amx("%s was kicked for failure to join a team within 2 minutes.", name)
        
server_cmd("kick #%d  Failure to join a team within 2 minutes."get_user_userid(taskid-TASK_CHECK))
    } 



fysiks 04-28-2012 12:26

Re: server_cmd message without "
 
Quote:

Originally Posted by tcPane (Post 1697887)
There is some bugs in this code. Can someone fix this code?

You have to tell us what the "bugs" are, otherwise we can't help you.

tcPane 04-29-2012 13:12

Re: server_cmd message without "
 
It doesn't work. After 2 minutes don't disconnect/kick player.


All times are GMT -4. The time now is 19:59.

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