Raised This Month: $ Target: $400
 0% 

client_print problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
da_ciouzan_oan
Junior Member
Join Date: Jun 2010
Old 11-22-2011 , 06:18   client_print problem
Reply With Quote #1

Hello,
I have some problems with client_print

This is how I declared my vars
Code:
#define _ACHIEVEMENT_Max 128 enum ACHIEVEMENT_Info {     ACHIEVEMENT_Name[ 32 ],     ACHIEVEMENT_Message[ 192 ] } new _ACHIEVEMENT_GlobalInfo[ _ACHIEVEMENT_Max ][ ACHIEVEMENT_Info ]

I read the achievement data from a file, but the weird thing is.. that when I try to print the stored string into chat, it shows me '[AC] Ai primit medalia xph`XPH@80('
Code:
client_print(id, print_chat, "[AC] Ai primit medalia %s, ^"%s^"", _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Name ], _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Message ])

BUT when I use the same variables to print the stored string into server console, it's nothing wrong..
Code:
log_amx("[status] ID %d, nume: %s, mesaj: %s", id_medalie, _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Name ], _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Message ])
Showing: 'L 11/22/2011 - 13:00:21: [achievements.amxx] [status] ID 3, nume: Life Hater, mesaj: Sinucide-te o data'

id_medalie is 3 in both cases.

Thanks in advance ^^.

LE: BTW, is there any posibility to change the volume of a sound using emit_sound so I can hear it louder?

LE2: Great, now crashes the server..
Code:
register_event("DeathMsg", "onPlayerKill", "a")
Code:
public onPlayerKill(killer, victim, headshot, wpnname[]) {     killer = read_data(1)     victim = read_data(2)     headshot = read_data(3)     read_data(4, wpnname, 31)         if(killer == 0 || killer == victim)         ACHIEVEMENT_Earn(victim, 3) }
Code:
ACHIEVEMENT_Earn(id, id_medalie) {     new nume_player[ 32 ], players[ 32 ], num     get_players(players, num)     get_user_name(id, nume_player, charsmax(nume_player))     for(new i; i < num; i++)     {         if(is_user_connected(players[ i ]))         {             if(players[ i ] == id)             {                 client_print(id, print_chat, "[AC] Ai primit medalia %s, ^"%s^"", _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Name ], _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Message ]))                 continue;             }             client_print(players[ i ], print_chat, "[AC] %s a primit medalia %s !", nume_player, _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Name ])         }     }     log_amx("[status] %s a primit medalia %s, ^"%s^"", nume_player, _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Name ], _ACHIEVEMENT_GlobalInfo[ id_medalie ][ ACHIEVEMENT_Message ])     _ACHIEVEMENT_PlayerInfo[ id ][ id_medalie ] = 1 }

Last edited by da_ciouzan_oan; 11-22-2011 at 07:38.
da_ciouzan_oan is offline
 



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 08:30.


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