Removing task waiting to call dispInfo if client disconnects before the task is executed. This fixes run time errors.

This commit is contained in:
Johnny Bergström 2005-02-21 00:31:52 +00:00
parent 3774575160
commit 7b8165fe6f
2 changed files with 16 additions and 8 deletions

View File

@ -45,8 +45,14 @@ public plugin_init() {
#if defined DISPLAY_MSG #if defined DISPLAY_MSG
public client_putinserver(id) { public client_putinserver(id) {
if (is_user_bot(id))
return
set_task(15.0,"dispInfo",id) set_task(15.0,"dispInfo",id)
} }
public client_disconnect(id) {
remove_task(id)
}
#endif #endif
public cmdHelp(id,level,cid) { public cmdHelp(id,level,cid) {
@ -88,8 +94,6 @@ public cmdHelp(id,level,cid) {
#if defined DISPLAY_MSG #if defined DISPLAY_MSG
public dispInfo(id) { public dispInfo(id) {
if (!is_user_connected(id))
return
client_print(id,print_chat,"%L",id,"TYPE_HELP") client_print(id,print_chat,"%L",id,"TYPE_HELP")
new nextmap[32] new nextmap[32]
get_cvar_string("amx_nextmap",nextmap,31) get_cvar_string("amx_nextmap",nextmap,31)

View File

@ -71,10 +71,14 @@ public plugin_init()
#if defined DISPLAY_MSG #if defined DISPLAY_MSG
public client_putinserver(id) { public client_putinserver(id) {
if (get_cvar_num("amx_client_languages")) if (get_cvar_num("amx_client_languages") && !is_user_bot(id))
set_task(10.0,"dispInfo",id) set_task(10.0,"dispInfo",id)
} }
public client_disconnect(id) {
remove_task(id)
}
public dispInfo(id) public dispInfo(id)
{ {
if (get_cvar_num("amx_client_languages")) if (get_cvar_num("amx_client_languages"))