AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Superhero Mod Change/Modification (https://forums.alliedmods.net/showthread.php?t=2868)

Trumpet_Rhapsody 06-19-2004 03:45

Superhero Mod Change/Modification
 
2 Attachment(s)
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();    } }

jtp10181 06-19-2004 11:08

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.

BAILOPAN 06-19-2004 11:58

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.

Trumpet_Rhapsody 06-19-2004 12:19

1 Attachment(s)
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.

jtp10181 06-20-2004 03:12

1 Attachment(s)
ok try this one out

Trumpet_Rhapsody 06-20-2004 03:27

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 :lol: )

jtp10181 06-20-2004 09:36

1 Attachment(s)
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.

Trumpet_Rhapsody 06-20-2004 11:56

Mmm it worked better with it as id, now when it runs the client drops. No errors, the client just drops.

Trumpet_Rhapsody 06-20-2004 18:38

Your updated plugin doesn't crash the server or kick the client, but the rings don't show anymore. Any other ideas?

devicenull 06-20-2004 20:29

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 :P


All times are GMT -4. The time now is 14:37.

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