Raised This Month: $ Target: $400
 0% 

Debugging Bomb Drop [SOLVED]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
The Specialist
BANNED
Join Date: Nov 2006
Old 11-30-2006 , 13:52   Debugging Bomb Drop [SOLVED]
Reply With Quote #1

Ok im still trying to get my follwo the the bomb plugin apporved but im getting a run time error when i drop the bomb and get punished
Code:
L 11/30/2006 - 12:42:21: Start of error session.
L 11/30/2006 - 12:42:21: Info (map "de_dust_cz") (logfile "error_113006.log")
L 11/30/2006 - 12:42:21: [CSTRIKE] Invalid player 1
L 11/30/2006 - 12:42:22: [AMXX] Displaying debug trace (plugin "follow_the_bomb.amxx")
L 11/30/2006 - 12:42:22: [AMXX] Run time error 10: native error (native "cs_get_user_money")
L 11/30/2006 - 12:42:22: [AMXX]    [0] follow_the_bomb.sma::punish_mode (line 111)
L 11/30/2006 - 12:42:22: [AMXX]    [1] follow_the_bomb.sma::bomb_is_dropped (line 180)

Code:
</p><p>#include <amxmodx></p><p>#include <engine></p><p>#include <fun></p><p>#include <cstrike></p><p>new g_iFollow_Bomb;</p><p>new g_iPunish;</p><p>new g_iRadius;</p><p>new g_Mode[8];</p><p>new Float:c4origin[3];</p><p>new Float:pOrigin[3];</p><p>public plugin_init()</p><p>{</p><p> register_plugin("Follow The Bomber","1.0","The Speicialist");</p><p> register_dictionary("follow_the_bomb.txt");</p><p> register_event("ResetHUD","reset_hud","be");</p><p> register_event("BarTime", "bomb_planting", "be", "1=3");</p><p> register_logevent("bomb_is_planted", 3, "2=Planted_The_Bomb");</p><p> register_logevent("bomb_is_dropped", 3, "2=Dropped_The_Bomb");</p><p> register_logevent("bomb_defuse_no_kit", 3, "2=Begin_Bomb_Defuse_Without_Kit");</p><p> register_logevent("bomb_defuse_kit", 3, "2=Begin_Bomb_Defuse_With_Kit");</p><p> g_iFollow_Bomb = register_cvar("ftb_switch","1");</p><p> g_iPunish = register_cvar("ftb_punishment","a");</p><p> g_iRadius = register_cvar("ftb_radius","1000");</p><p> set_task(2.0,"find_bomb",0,"",0,"b");</p><p>}</p><p>// reset hud event</p><p>public reset_hud(id)</p><p>{ </p><p> if( cs_get_user_team(id) == CS_TEAM_T && find_ent_by_class(-1 , "weapon_c4"))</p><p> {</p><p> set_hudmessage(255, 255, 255, -1.0, 0.31, 0, 6.0, 12.0);</p><p> show_hudmessage(id, "%L",id,"FOLLOW",get_pcvar_num(g_iRadius));</p><p> return PLUGIN_HANDLED;</p><p> }</p><p> return PLUGIN_HANDLED;</p><p>}</p><p>// find bomb and players in and out of range </p><p>public find_bomb(id)</p><p>{</p><p> new g_iBomb = find_ent_by_class(-1,"weapon_c4");</p><p> if(get_pcvar_num(g_iFollow_Bomb)==0 || g_iBomb == 0)</p><p> {</p><p> return PLUGIN_HANDLED;</p><p> }else{</p><p> entity_get_vector(g_iBomb,EV_VEC_origin,c4origin);</p><p> new players[32];</p><p> new num;</p><p> get_players(players,num,"ace","TERRORIST");</p><p>&nbsp;</p><p> for(new i=0;i<num;i++)</p><p> {</p><p> entity_get_vector(players[i],EV_VEC_origin,pOrigin);</p><p> new Float: g_Dist = get_distance_f(c4origin,pOrigin);</p><p> new g_iDist = floatround(g_Dist);</p><p>&nbsp;</p><p> set_hudmessage(255, 255, 255, -1.0, 0.79, 0, 6.0, 2.0);</p><p> show_hudmessage(players[i], "%L",players,"METER",g_iDist);</p><p>&nbsp;</p><p> if( g_Dist > get_pcvar_num(g_iRadius))</p><p> {</p><p> punish_mode(players[i]);</p><p>&nbsp;</p><p> }else if(g_Dist > get_pcvar_num(g_iRadius) / 2)</p><p> {</p><p> set_hudmessage(255, 0, 0, -1.0, 0.31, 0, 6.0, 12.0);</p><p> show_hudmessage(players[i], "%L",players,"WARNING");</p><p> }</p><p> }</p><p> }</p><p> return PLUGIN_HANDLED;</p><p>}</p><p>// punishment function </p><p>public punish_mode(players)</p><p>{</p><p> get_pcvar_string(g_iPunish,g_Mode,7);</p><p> new g_iMode = read_flags(g_Mode);</p><p> new g_iArmor = get_user_armor(players);</p><p> new g_iMoney = cs_get_user_money(players);</p><p> new g_iHealth = get_user_health(players); </p><p>&nbsp;</p><p> set_hudmessage(255, 255, 255, -1.0, 0.34, 0, 6.0, 2.0);</p><p> show_hudmessage(players, "%L",players,"LEAVING");</p><p>&nbsp;</p><p> if(g_iMode & 1 ) // flag a </p><p> {</p><p> user_slap(players,0);</p><p> }</p><p> if(g_iMode & 2 ) // flag b </p><p> {</p><p> set_user_armor(players,(g_iArmor - 1));</p><p> }</p><p> if(g_iMode & 4 ) // flag c </p><p> {</p><p> strip_user_weapons(players);</p><p> }</p><p> if(g_iMode & 8 ) // flag d </p><p> {</p><p> cs_set_user_money(players,(g_iMoney - 10));</p><p> }</p><p> if(g_iMode & 16) // flag e </p><p> {</p><p> user_kill(players);</p><p> } </p><p> if(g_iMode & 32 ) // flag f </p><p> {</p><p> return PLUGIN_HANDLED;</p><p> }</p><p> if(g_iMode & 64) // flag g </p><p> {</p><p> set_user_health(players,(g_iHealth - 1));</p><p> }</p><p> return PLUGIN_HANDLED;</p><p>}</p><p>// bar time event detects planting</p><p>public bomb_planting(id)</p><p>{</p><p> new i,num;</p><p> new g_Name[32];</p><p> new players[32];</p><p> get_user_name(id,g_Name,31);</p><p> get_players(players,num,"ace","TERRORIST");</p><p> for(i = 0; i < num ; ++i)</p><p> {</p><p> set_hudmessage(255, 255, 255, -1.0, 0.35, 0, 6.0, 12.0);</p><p> show_hudmessage(players[i], "%L",id,"PLANTING",g_Name);</p><p> return PLUGIN_HANDLED;</p><p> }</p><p> return PLUGIN_HANDLED;</p><p>}</p><p>// logevent cathces bomb is planted message </p><p>public bomb_is_planted(id)</p><p>{</p><p> new players[32],num;</p><p> get_players(players,num,"ace","TERRORIST");</p><p> for(new i = 0; i < num ; ++i)</p><p> {</p><p> set_hudmessage(255, 255, 255, -1.0, 0.34, 0, 6.0, 12.0);</p><p> show_hudmessage(players[i], "%L",players,"PLANTED");</p><p> return PLUGIN_HANDLED;</p><p> }</p><p> return PLUGIN_HANDLED;</p><p>}</p><p>// detects if the bomb was dropped </p><p>public bomb_is_dropped(players)</p><p>{</p><p> new players = get_loguser_index();</p><p> punish_mode(players); </p><p>&nbsp;</p><p> set_hudmessage(255, 255, 255, -1.0, 0.19, 0, 6.0, 12.0);</p><p> show_hudmessage(players, "%L",players,"DROPPED"); </p><p>&nbsp;</p><p> new ct_players[32]</p><p> new num,i;</p><p> entity_get_vector(ct_players[i],EV_VEC_origin,pOrigin);</p><p> new Float: g_Dist = get_distance_f(c4origin,pOrigin);</p><p> new g_iDist = floatround(g_Dist);</p><p> get_players(ct_players,num,"ace","CT");</p><p> for( i = 0 ; i < num ; ++i)</p><p> {</p><p> set_hudmessage(255, 255, 255, -1.0, 0.24, 0, 6.0, 12.0);</p><p> show_hudmessage(ct_players[i], "Bomb Down ^n %i Units Away!",g_iDist);</p><p> } </p><p>}</p><p>// detects if the bomb is being defused with no kit </p><p>public bomb_defuse_no_kit(id)</p><p>{</p><p> new id = get_loguser_index();</p><p> new g_Name[33];</p><p> new players[32],num;</p><p> get_user_name(id,g_Name,32);</p><p> get_players(players,num,"ace","CT");</p><p> for(new i = 0 ; i < num ; ++i)</p><p> {</p><p> set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 12.0);</p><p> show_hudmessage(players[i], "%L",players,"NO_KIT",g_Name);</p><p> } </p><p>}</p><p>// detects if the bomb is being defused with a kit</p><p>public bomb_defuse_kit(id)</p><p>{</p><p> new id = get_loguser_index();</p><p> new g_Name[33];</p><p> new players[32],num;</p><p> get_user_name(id,g_Name,32);</p><p> get_players(players,num,"ace","CT");</p><p> for(new i = 0 ; i < num ; ++i)</p><p> {</p><p> set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 12.0);</p><p> show_hudmessage(players[i], "%L",players,"KIT",g_Name);</p><p> } </p><p>}</p><p>// function to get index from log events</p><p>stock get_loguser_index() </p><p>{</p><p> new loguser[80], name[32];</p><p> read_logargv(0, loguser, 79);</p><p> parse_loguser(loguser, name, 31);</p><p> return get_user_index(name);</p><p>}</p><p>

Last edited by The Specialist; 11-30-2006 at 14:46.
The Specialist is offline
Send a message via AIM to The Specialist
 



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 06:54.


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