Raised This Month: $ Target: $400
 0% 

Memory probs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-24-2005 , 23:17   Memory probs
Reply With Quote #1

OK really dont know how to fix this, not a set_task pro


but this keeps recurring ( when sheild is activated )

Code:
L 09/24/2005 - 23:16:38: [AMXX] Displaying debug trace (plugin "SS2.amxx")
L 09/24/2005 - 23:16:38: [AMXX] Run time error 5: memory access 
L 09/24/2005 - 23:16:38: [AMXX]    [0] SS2.sma::activate_sheild (line 66

ok line 66 is

Code:
new id = parms[0]

i originally tried parms, parms[], and now parms[0] but i keep getting that same error!

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "Super Sheild!" #define VERSION "1.0" #define AUTHOR "Zenith77" #define TASK_ACTIVATE 132456789 new mXBeam public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_cvar( "sheild_radius", " 200 " )     register_cvar( "sheild_time", "3.0" )         register_clcmd( "amx_sheild", "sheild_on", ADMIN_IMMUNITY, " if you dont know, dont worry " )     register_clcmd( "amx_sheild_off", "sheild_off", ADMIN_IMMUNITY, " zomg go away " )     } public plugin_precache() {         mXBeam = precache_model( "sprites/xbeam1.spr" )         } public sheild_on(id, level, cid) {             if( !cmd_access(id ,level ,cid, 1)) {         return PLUGIN_CONTINUE     }         client_print(id, print_chat, " ** Sheild Activated " )         new parms[1]     parms[0] = id         set_task( get_cvar_float("sheild_time"), "activate_sheild", TASK_ACTIVATE+id, parms[0], 0, "b" )         return PLUGIN_CONTINUE } public sheild_off(id, level, cid) {             if( !cmd_access(id ,level ,cid, 1)) {         return PLUGIN_CONTINUE     }         remove_task(TASK_ACTIVATE+id)         client_print(id, print_chat, " ** Sheild Deactivated " )         return PLUGIN_CONTINUE }     public activate_sheild(parms[0]) {         new id = parms[0]     new distance, origin[3], iOrigin[3]         get_user_origin(id, origin, 0)             message_begin(MSG_BROADCAST,SVC_TEMPENTITY) // TE_BEAMCYLINDER     write_byte( 21 )     write_coord(origin[0])     write_coord(origin[1])     write_coord(origin[2] + 15)     write_coord(origin[0])     write_coord(origin[1])     write_coord(origin[2] + get_cvar_num("sheild_radius") )     write_short( mXBeam )     write_byte( 0 ) // startframe     write_byte( 1 ) // framerate     write_byte( 8 ) // 3 life 2     write_byte( 50 ) // width     write_byte( 1 ) // noise     write_byte( 255 ) // r     write_byte( 0 ) // g     write_byte( 0 ) // b     write_byte( 50) //brightness     write_byte( 0 ) // speed     message_end()     for( new i = 1; i <= get_maxplayers(); i++) {                 if( !is_user_connected(i) || id == i) continue                                 get_user_origin(i, iOrigin, 0)                 distance = get_distance(origin, iOrigin)                 if( distance <= get_cvar_num("sheild_radius") ) {                                     new iRed = random_num(0, 255)             new iBlue = random_num(0, 255)             new iGreen = random_num(0, 255)                         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)             write_byte(1)       // TE_BEAMPOINT             write_short(id)             write_coord(iOrigin[0])             write_coord(iOrigin[1])             write_coord(iOrigin[2])             write_short(mXBeam)             write_byte(0)             write_byte(10)             write_byte(10)             write_byte(30)             write_byte(5)             write_byte(iRed)             write_byte(iBlue)             write_byte(iGreen)             write_byte(200)             write_byte(15)             message_end()                         user_kill(i, 1) //ZOMG I GOT ELECTRICUTED!!!!!         }     }         return PLUGIN_HANDLED }
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 09-24-2005 , 23:23  
Reply With Quote #2

Try using
Code:
set_task( get_cvar_float("sheild_time"), "activate_sheild", TASK_ACTIVATE+id, _,_, "b" ) //..... public activate_sheild( id ) {         id -= TASK_ACTIVATE;
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-24-2005 , 23:30  
Reply With Quote #3

Just thought I'd pop in here to say i before e except after c except for many exceptions, of which shield is not an exception
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-24-2005 , 23:34  
Reply With Quote #4

zomg sucide your the best


@avalanche huh ?
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 09-24-2005 , 23:38  
Reply With Quote #5

You spelled shield wrong dummy head. and i neglected to change it for you.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 17:40.


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