Raised This Month: $ Target: $400
 0% 

Client Connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 10-07-2007 , 09:41   Client Connect
Reply With Quote #1

Problems:
----------
1. Player name (name)
it replaces it with the hostname instead and I don't know why.
hostname, mapname, nextmap, players works perfecly.

2. spk (looked into speech.ini, but it wasn't same did I get when I didn't hear
the sounds in-game, hope you have an solution to get them to work without to do them into 1 .wav file so players don't need to download)

------------
Suggestion:
I can't really make timeleft into it, wonder if you could do it (below nextmap).

Code:
#include <amxmodx>
 
public plugin_init() {
 register_plugin("AMXX Client Connect", "1.0", "Rirre")
 set_task(16.0, "ClientConnect")
 return PLUGIN_CONTINUE
}
 
public ClientConnect(id) {
    new name[32], hostname[64]
    new mapname[32], nextmap[32]
 
    get_cvar_string("hostname",hostname,63)
    get_user_name(id,name,31)
    get_mapname(mapname,31)
    get_cvar_string("amx_nextmap",nextmap,31)
 
    client_cmd(id, ^"spk \'fvox/fuzz fuzz hev_logon\'^")
    set_hudmessage(200,255,0, 0.0, 0.34, 0, 6.0, 15.0)
    show_hudmessage(id, "Hi %s!^nWelcome to %s^nMap: %s^nNextmap: %s^nPlayers: %d/%d",name,hostname,mapname,nextmap,get_playersnum(),get_maxplayers())
    return PLUGIN_CONTINUE
}
 
public plugin_precache() {
    precache_sound("fvox/fuzz.wav")
    precache_sound("fvox/hev_logon.wav")
}
Rirre is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-07-2007 , 09:56   Re: Client Connect
Reply With Quote #2

In your loop_task, id is 0 = server.
Also you don't need to precache sounds.

Try this :
Code:
#include <amxmodx> new g_maxplayers   public plugin_init() {     register_plugin("AMXX Client Connect", "1.0", "Rirre") } public plugin_cfg() {     g_maxplayers = get_maxplayers() }   public client_putinserver(id) {     new name[32], hostname[64]     new mapname[32], nextmap[32]       get_cvar_string("hostname",hostname,63)     get_user_name(id,name,31)     get_mapname(mapname,31)     get_cvar_string("amx_nextmap",nextmap,31)       client_cmd(id, "spk ^"fvox/fuzz fuzz hev_logon^"")     set_hudmessage(200,255,0, 0.0, 0.34, 0, 6.0, 15.0)     show_hudmessage(id, "Hi %s!^nWelcome to %s^nMap: %s^nNextmap: %s^nPlayers: %d/%d",name,hostname,mapname,nextmap,get_playersnum(),g_maxplayers) }
ConnorMcLeod is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 10-07-2007 , 10:31   Re: Client Connect
Reply With Quote #3

EDIT: thanks.

Last edited by Rirre; 10-07-2007 at 14:08.
Rirre 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 16:16.


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