Raised This Month: $ Target: $400
 0% 

[Please help me!]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xing9634
Junior Member
Join Date: Sep 2012
Old 02-13-2013 , 08:10   [Please help me!]
Reply With Quote #1

L 02/13/2013 - 21:065: [AMXX] Run time error 4: index out of bounds
L 02/13/2013 - 21:065: [AMXX] [0] jbk.sma::Fwd_Touch (line 71)

PHP Code:
public Fwd_Touch(id)
{
 if(
foot[id] == 0)
    {
    return 
PLUGIN_CONTINUE
    
}
 if(
is_user_alive(id))
        
set_user_footsteps(id,1)
 return 
FMRES_IGNORED

What's wrong?

Last edited by xing9634; 02-13-2013 at 08:10.
xing9634 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-13-2013 , 08:20   Re: [Please help me!]
Reply With Quote #2

Rest of the code? Or at least what line is the error on and where is that variable defined.
__________________
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
xing9634
Junior Member
Join Date: Sep 2012
Old 02-13-2013 , 08:26   Re: [Please help me!]
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
Rest of the code? Or at least what line is the error on and where is that variable defined.
if(foot[id] == 0)
xing9634 is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 02-13-2013 , 08:42   Re: [Please help me!]
Reply With Quote #4

How do you initialize the foot variable?
Backstabnoob is offline
xing9634
Junior Member
Join Date: Sep 2012
Old 02-13-2013 , 08:52   Re: [Please help me!]
Reply With Quote #5

Quote:
Originally Posted by Backstabnoob View Post
How do you initialize the foot variable?

foot[id] = 0

Last edited by xing9634; 02-13-2013 at 08:53.
xing9634 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-13-2013 , 09:15   Re: [Please help me!]
Reply With Quote #6

Please provide the entire code
__________________
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
xing9634
Junior Member
Join Date: Sep 2012
Old 02-13-2013 , 09:48   Re: [Please help me!]
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
Please provide the entire code
This is the entire code:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <unlimited_money>
#define PLUGIN "No Footsteps"
#define VERSION "1.0"
#define AUTHOR "AMXX Community"
new foot[33]
new 
g_dp_access
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("dp_cost""1000"
    
register_event("ResetHUD","RoundStart","b")
    
register_clcmd("say /foot","ShowPayForItMenu")
    
register_forward FM_Touch"Fwd_Touch" 
    
g_dp_access register_cvar("amx_dp_access""c");
}
 
public 
ShowPayForItMenu(id) {
                        new 
iAccess[32];
                        
get_pcvar_string(g_dp_accessiAccess31);
                        if(
get_user_flags(id) & read_flags(iAccess) == 0)
                        {
    new 
msg[256]
    
format(msg255"^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧?鍙湁^x03浼氬憳^x01鎵嶈兘璐拱^x04銆愰潤姝ュ崱銆慯x04.")
    
client_color(ididmsg)
    return 
PLUGIN_CONTINUE
   
}
   if(!
is_user_alive(id)) {
                        new 
msg[256]
   
format(msg255"^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧?鍙湁^x04娲荤潃^x01鎵嶈兘璐拱^x04銆愰潤姝ュ崱銆慯x01.")
   
client_color(ididmsg)
   return 
PLUGIN_HANDLED  
   
}
                        if(
foot[id] > 0){
   new 
msg[256]
   
format(msg255"^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧穅x01,浣犲凡璐拱浜哵x04銆愰潤姝ュ崱銆慯x01,涓嶈兘鍐峖x04璐拱^x01浜?")
   
client_color(ididmsg)
                        return 
PLUGIN_CONTINUE
                        
}
   new 
money cs_get_user_money2(id
   new 
dpcost get_cvar_num("dp_cost"
   if(
money dpcost)  { 
   new 
msg[256]
   
format(msg255"^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧穅x01,浣犳矑鏈夎冻澶犵殑^x04閲戦挶^x01璐拱^x04銆愰潤姝ュ崱銆慯x01.")
   
client_color(ididmsg)
   } 
                        else
                        {
   
foot[id] = 1
   cs_set_user_money2
(idmoney dpcost)
   new 
player_name[32
   
get_user_name(idplayer_name31)
   new 
msg[256]
   
format(msg255"^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01鎭枩^x03%s^x01鎴愬姛璐拱浜嗕竴涓猑x04銆愰潤姝ュ崱銆慯x01,瑕佸皬蹇冨摝!"player_name)
   
client_color(0idmsg)
                        }
   return 
PLUGIN_CONTINUE 
}
public 
Fwd_Touch(id)
{
 if(
foot[id] == 0)
    {
    return 
PLUGIN_CONTINUE
    
}
 if(
is_user_alive(id))
        
set_user_footsteps(id,1)
 return 
FMRES_IGNORED
}  
public 
RoundStart(id)
{
        
foot[id] = 0
}
public 
client_color(playeridcoloridmsg[])
{
 
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid
 
write_byte(colorid)
 
write_string(msg)
 
message_end()
}
 
/* AMXX-Studio浠g爜涓嶈兘浣庝笌杩欓噷 杞欢姹夊寲SiMen.K.
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by xing9634; 02-13-2013 at 09:49.
xing9634 is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 02-15-2013 , 16:53   Re: [Please help me!]
Reply With Quote #8

Check if id is player in Fwd_Touch
Backstabnoob 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 20:34.


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