Member
Join Date: Mar 2015
Location: Isfahan, Iran
|
03-26-2015
, 11:59
Problem with tasks & players
|
#1
|
I have a problem with tasks. I created a server and activated my plugin, tasks works fine for me, but for my another client, they don't work.
Here is my code, what am I doing wrong?
Code:
public plugin_init() {
...
set_task( 1.0, "Check_Prizes",0,"", 0, "b" )
}
public Check_Prizes() {
new players[32], playersnum
get_players(players, playersnum)
// First, check glows
new i
for (i = 0; i < playersnum; i++) {
if ( ! glows[i] )
continue;
if ( is_user_alive( i ) )
glows[i] = glows[i] - 1
if ( glows[i] > 1 ) {
set_hudmessage(255, 0, 255, 0.05, 0.5, 0, 6.0, 1.0, 0.1, 0.1, 3)
show_hudmessage(i, "Zamane Baghi Mande Glow Shoma: %d", glows[i] )
if (is_user_alive(i))
set_user_rendering( i, kRenderFxGlowShell, glowr[i], glowg[i], glowb[i], kRenderTransAlpha, 0.5 )
} else {
set_hudmessage(255, 0, 0, 0.05, 0.5, 0, 6.0, 1.0, 0.1, 0.1, 3)
show_hudmessage(i, "Glow Shoma Tamam Shod!" )
set_user_rendering( i, kRenderFxNone )
client_print_color( i, print_chat, "!g* Glow Shoma Tamom Shod!" )
}
}
// Check the hook
for (i = 0; i < playersnum; i++) {
if ( ! hookers[i] )
continue;
if ( is_user_alive( i ) )
hookers[i] = hookers[i] - 1
new hookername[32]
get_user_name(i, hookername, 32)
if ( hookers[i] > 1 ) {
set_hudmessage(255, 255, 0, 0.05, 0.75, 0, 6.0, 1.0, 0.1, 0.1, 2)
show_hudmessage(i, "Zamane Baghi Mande Hook Shoma: %d", hookers[i] )
if (is_user_alive(i))
server_cmd( "amx_givehook %s", hookername )
} else {
set_hudmessage(255, 0, 0, 0.05, 0.75, 0, 6.0, 1.0, 0.1, 0.1, 2)
show_hudmessage(i, "Hook Shoma Tamam Shod!" )
server_cmd( "amx_takehook %s", hookername )
}
}
}
Thanks. :X
__________________
Last edited by xEhsaan; 03-26-2015 at 12:01.
|
|