Raised This Month: $ Target: $400
 0% 

respawn runtime error.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AdogeN
Senior Member
Join Date: Feb 2007
Old 05-25-2007 , 12:42   respawn runtime error.
Reply With Quote #1

#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <cstrike>
public plugin_init()
{
register_plugin("respawn","1","atambo")
register_cvar("amx_respawn","1")
register_event("DeathMsg","on_Death","a")
register_forward(FM_SetModel,"check_model",0)
}
public on_Death()
{
if(get_cvar_num("amx_respawn")!=1)
return PLUGIN_CONTINUE
new id = read_data(2)
set_task(0.5,"player_spawn",id)
set_task(0.7,"player_spawn",id)
return PLUGIN_CONTINUE
}
public player_spawn(id)
{
if(cs_get_user_team(id)==CS_TEAM_SPECTATOR) <--------- this is 23 line.
return PLUGIN_CONTINUE
spawn(id)
return PLUGIN_CONTINUE
}
public check_model(id)
{
if(get_cvar_num("amx_respawn")!=1)
return PLUGIN_CONTINUE
if(!is_user_connected(id) || is_user_alive(id))
return PLUGIN_CONTINUE
new model[32]
cs_get_user_model(id,model,31)
if(containi(model,"urban")!=-1 || containi(model,"terror")!=-1 || containi(model,"leet")!=-1 || containi(model,"arctic")!=-1 || containi(model,"gsg")!=-1 || containi(model,"gign")!=-1 || containi(model,"sas")!=-1 || containi(model,"guerilla")!=-1 || containi(model,"vip")!=-1)
{
set_task(0.5,"player_spawn",id)
set_task(0.7,"player_spawn",id)
}
return PLUGIN_CONTINUE
}

==============error log============================
L 05/25/2007 - 16:41:05: [CSTRIKE] Invalid player 5
L 05/25/2007 - 16:41:05: [AMXX] Displaying debug trace (plugin "amx_respawn.amxx")
L 05/25/2007 - 16:41:05: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 05/25/2007 - 16:41:05: [AMXX] [0] amx_respawn.sma::player_spawn (line 23)
============================================= ===========
====================log====================== ============
L 05/25/2007 - 16:41:04: "AdogeN<28><STEAM_0:1899328><TERRORIST> " killed "Singer<82><STEAM_0:0:4768669><CT>" with "throwing_knife"
L 05/25/2007 - 16:41:05: "Singer<82><STEAM_0:0:4768669><CT>" disconnected
============================================= ==========
i'm guess ..Maybe player die and fast out. => run time error .
Solution ??

Last edited by AdogeN; 05-25-2007 at 12:44.
AdogeN is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-25-2007 , 12:52   Re: respawn runtime error.
Reply With Quote #2

Try to post code in [C O D E] or [S M A L L] tags..its better to read...

try to put this check before call a native with an ID
Code:
if(!is_user_connected(id)) return PLUGIN_HANDLED_MAIN
__________________
regalis is offline
AdogeN
Senior Member
Join Date: Feb 2007
Old 05-25-2007 , 23:39   Re: respawn runtime error.
Reply With Quote #3

thx.
where line put it ? or edite?
AdogeN is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-25-2007 , 23:59   Re: respawn runtime error.
Reply With Quote #4

Right before you call cs_get_user_team
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
AdogeN
Senior Member
Join Date: Feb 2007
Old 05-26-2007 , 00:37   Re: respawn runtime error.
Reply With Quote #5

thx man.
AdogeN 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 10:39.


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