AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   XMAS Sound (https://forums.alliedmods.net/showthread.php?t=144165)

xakintosh 11-29-2010 17:08

XMAS Sound
 
Can you help me with this code, i have some pc issue (desktop freeze when PLAYTIME is up) :attack:

Code:
#include < amxmodx > #include < cstrike > #include < fakemeta > #define MAXPLAYERS 32 #define PLAYTIME 5.0 new Float:g_PlayTime [MAXPLAYERS+1] public plugin_init() {     register_plugin("x","x","x")     register_forward ( FM_PlayerPreThink, "fw_PlayerPreThink" ) } public client_putinserver(id) {     if (!is_user_bot(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {         g_PlayTime[id] = get_gametime()     } } public fw_PlayerPreThink(id) {     if (!is_user_alive (id) || !cs_get_user_team (id))         return         while (get_gametime() - g_PlayTime [id] > PLAYTIME) {         set_task(5.0, "xmas_sound", 0, "", 0, "b")         g_PlayTime[id] -= PLAYTIME     } } public plugin_precache() {     precache_sound("server/xmas.wav") } public xmas_sound(id) {     //emit_sound(0, CHAN_VOICE, xs_file, 1.0, ATTN_NORM, 1, PITCH_NORM)     emit_sound(id, CHAN_AUTO, "server/xmas.wav", 1.0, ATTN_IDLE, 0, PITCH_NORM) }
I try 10 times already ;[


All times are GMT -4. The time now is 11:25.

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