AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Print chat.. (https://forums.alliedmods.net/showthread.php?t=170873)

kramesa 10-29-2011 22:36

Print chat..
 
Hi, the print chat not works... Look:

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Record POV"
#define VERSION "1.0.2"
#define AUTHOR "Krames"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_cvar("amx_recordpov""0"FCVAR_SERVER/* Grava POV quando o Jogador conecta ao Server */
    
    
register_concmd("amx_record""CmdRecordPov"ADMIN_CVAR"Grava a POV no LO3")    
}

public 
client_putinserver(id)
{
    if(
get_cvar_num("amx_recordpov") <= 0)
    return
    
    
set_task(5.1"CmdRecordPov"id)
}

public 
CmdRecordPov(id)
{
    new 
date[32], name[31], map[30]
    
    
get_time("%d.%m.%Y"date31)
    
get_user_name(idname30)
    
get_mapname(map29)
    
    
client_print(idprint_chat"Iniciando uma Pov Demo com o nome de:")
    
client_print(idprint_chat"sb_%s_%s_%s.dem"namemapdate)
    
    
client_cmd(id"stop;record sb_%s_%s_%s.dem"namemapdate)
    
}

public 
client_disconnect(id)
{
    
client_cmd(id"stop")



Evaldas.Grigas 10-30-2011 03:44

Re: Print chat..
 
I use this:
PHP Code:

    new date[32]
    new 
map[33]
    new 
szName[33]
    
    
get_user_name(idszNamecharsmax(szName)) 
    
get_mapname (map32
    
get_time("%d.%m.%Y"date31)
    
    
client_print(idprint_chat"Your name: %s. Map: %s. Date: %s"szNamemapdate

And it works perfectly.

Backstabnoob 10-30-2011 06:30

Re: Print chat..
 
It won't print if you are unassigned, however there is nothing wrong on that code that would stop the messages from being shown.

1) this is useless:
Code:
public client_disconnect(id) {     client_cmd(id, "stop") }

You cannot call client_cmd() on already disconnected player

2) player nick length can be max of 32 (33), not 30 (31)

kramesa 10-30-2011 09:12

Re: Print chat..
 
OK, thx all


All times are GMT -4. The time now is 14:27.

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