Raised This Month: $ Target: $400
 0% 

Superhero Mod Change/Modification


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Trumpet_Rhapsody
Junior Member
Join Date: Jun 2004
Old 06-19-2004 , 03:45   Superhero Mod Change/Modification
Reply With Quote #1

I've been trying to modify the Daredevil character's ESP rings to show as red for Terrorists, and Blue for Counter-Terrorists (and down the road have cvars to show only your team, or the enemy). Since I know basically none of the "Small" scripting language, I've been getting code from other superheros. I've gotten most of the team detection and stuff from Xavier. Like I say I know pretty much nothing about Small scripting except what I've learned by reading plugins.

I've decided to post the code that I've modified, so if you don't want to d/l it you can just look to see the changes:
Code:
public daredevil_esp( id ) {    new players[SH_MAXSLOTS];    new c;    new vec1[3];    get_players(players,c,"a");    for(new i = 0; i < c; i++)    {      if(players[i]==id) continue;      get_user_origin(players[i],vec1,0);      if ( !is_user_alive(id) ) return      message_begin(MSG_ONE,SVC_TEMPENTITY,vec1,id)      write_byte( 21 );        write_coord(vec1[0]);        write_coord(vec1[1]);        write_coord(vec1[2] + 16);        write_coord(vec1[0]);        write_coord(vec1[1]);        write_coord(vec1[2] + 768 ) // test get_cvar_num("daredevel_radius") );  //1936      write_short( gSpriteWhite );        write_byte( 0 ); // startframe      write_byte( 1 ); // framerate      write_byte( 6 ); // 3 life 2      write_byte( 8 ); // width 16      write_byte( 1 ); // noise      if ( get_user_team(id) == 1) {           write_byte( 255 ); // r           write_byte( 100 ); // g           write_byte( 100 ); // b      }      else if ( get_user_team(id) == 2) {           write_byte( 100 ); // r           write_byte( 100 ); // g           write_byte( 255 ); // b      }      write_byte( get_cvar_num("daredevil_bright") ); //brightness      write_byte( 0 ); // speed      message_end();    } }
Attached Files
File Type: sma Get Plugin or Get Source (sh_daredevil.sma - 912 views - 3.9 KB)
File Type: sma Get Plugin or Get Source (sh_daredevil.sma - 834 views - 3.7 KB)
__________________
Server: MasterChiefs.hopto.org
-AMX Mod X - Plenty of Plugins
-MetaMod 1.17.1
Trumpet_Rhapsody is offline
Send a message via ICQ to Trumpet_Rhapsody Send a message via AIM to Trumpet_Rhapsody
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-19-2004 , 11:08  
Reply With Quote #2

Runtime error 7

Quote:
7 - AMX_ERR_STACKLOW Stack underflow. No idea how to cause it.
hehe.... what did you do? sorry I don't have tiome to look at this right now, but maybe later.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
BAILOPAN
Join Date: Jan 2004
Old 06-19-2004 , 11:58  
Reply With Quote #3

Code:
    daredevil_esp(id)   } } //---------------------------------------------------------------------------------------------- public daredevil_esp( id, pid )

It looks like you are pushing one argument into the stack and the function is expecting two. The stack underflow could mean it is looking for more in the stack and not seeing it.
__________________
egg
BAILOPAN is offline
Trumpet_Rhapsody
Junior Member
Join Date: Jun 2004
Old 06-19-2004 , 12:19  
Reply With Quote #4

Ok I fixed what you said Bailopan and it got rid of the compile warning, but when I tried to run it on my server it crashed and this time it didn't give me an error, it just locked up. I'll update the plugin above with the new version. Maybe you can look again and see if anything is wrong. Remember I know NOTHING about small so if you could spoon-feed me this that'd be great, lol.
Attached Files
File Type: sma Get Plugin or Get Source (superheromod.sma - 857 views - 89.6 KB)
__________________
Server: MasterChiefs.hopto.org
-AMX Mod X - Plenty of Plugins
-MetaMod 1.17.1
Trumpet_Rhapsody is offline
Send a message via ICQ to Trumpet_Rhapsody Send a message via AIM to Trumpet_Rhapsody
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-20-2004 , 03:12  
Reply With Quote #5

ok try this one out
Attached Files
File Type: sma Get Plugin or Get Source (sh_daredevil.sma - 962 views - 3.9 KB)
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Trumpet_Rhapsody
Junior Member
Join Date: Jun 2004
Old 06-20-2004 , 03:27  
Reply With Quote #6

Ah yes that helps a lot, that fixed alot of my problems, no more crashing, AND it displays the rings. BUT, big but, when it executes get_user_team it gets the player's team and makes everyone else's ESP rings the color of his team, INSTEAD of getting the individual player's team and displaying it's corresponding color. Any ideas on how to modify this to do that instead. (i'll be trial-and-erroring it till I get some help, which i hope i do )
__________________
Server: MasterChiefs.hopto.org
-AMX Mod X - Plenty of Plugins
-MetaMod 1.17.1
Trumpet_Rhapsody is offline
Send a message via ICQ to Trumpet_Rhapsody Send a message via AIM to Trumpet_Rhapsody
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-20-2004 , 09:36  
Reply With Quote #7

I'm sure its possible, let me take a look...

----

that was a simple fix

changed the "id" in the get user team to "i"

the i variable is being used in the loop and will be all the different player ids on the server.
Attached Files
File Type: sma Get Plugin or Get Source (sh_daredevil.sma - 931 views - 3.8 KB)
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Trumpet_Rhapsody
Junior Member
Join Date: Jun 2004
Old 06-20-2004 , 11:56  
Reply With Quote #8

Mmm it worked better with it as id, now when it runs the client drops. No errors, the client just drops.
__________________
Server: MasterChiefs.hopto.org
-AMX Mod X - Plenty of Plugins
-MetaMod 1.17.1
Trumpet_Rhapsody is offline
Send a message via ICQ to Trumpet_Rhapsody Send a message via AIM to Trumpet_Rhapsody
Trumpet_Rhapsody
Junior Member
Join Date: Jun 2004
Old 06-20-2004 , 18:38  
Reply With Quote #9

Your updated plugin doesn't crash the server or kick the client, but the rings don't show anymore. Any other ideas?
__________________
Server: MasterChiefs.hopto.org
-AMX Mod X - Plenty of Plugins
-MetaMod 1.17.1
Trumpet_Rhapsody is offline
Send a message via ICQ to Trumpet_Rhapsody Send a message via AIM to Trumpet_Rhapsody
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-20-2004 , 20:29  
Reply With Quote #10

Quote:
Originally Posted by jtp10181
Runtime error 7

Quote:
7 - AMX_ERR_STACKLOW Stack underflow. No idea how to cause it.
hehe.... what did you do? sorry I don't have tiome to look at this right now, but maybe later.
Whered you find that error code list

Sorry about the off topicness
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull 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 14:37.


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