Raised This Month: $ Target: $400
 0% 

Server crashing code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 12-16-2006 , 11:56   Server crashing code
Reply With Quote #1

The following Code is meant to give information
about Players and monsters you are looking at.
Actually it crashes the server if you look at an entity.
I probably am using the engfunc completely wrong.
Help please!
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #define VERSION "1.0" new const ally_thingie[2][8]= {     "Enemy",     "Friend" } public plugin_init() {     register_plugin("SC Player Info",VERSION,"Silencer")     set_task(0.3,"SCPI_Overwrite",0,"",0,"b") } public SCPI_RemoveMsg(x) {     set_hudmessage(0,0,0,0.1,0.62,0,0.0,0.1,0.0,0.0,1)     show_hudmessage(x,"a") } public SCPI_Overwrite() {     new iPlayers[32],iNum     get_players(iPlayers,iNum,"ach")     new x,target,body,name[32],hp_str[16],ap_str[16],classname[64],displayname[32],is_ally_str[8],hp,ap,is_ally     for(new i=0;i<iNum;i++)     {         x=iPlayers[i]         get_user_aiming(x,target,body,9999)         if(target>0)         {             if(target<33)             {                 engfunc(EngFunc_InfoKeyValue,target,"health",hp_str,15)                 engfunc(EngFunc_InfoKeyValue,target,"battery",ap_str,15)                 hp=str_to_num(hp_str)                 ap=str_to_num(ap_str)                 get_user_name(target,name,31)                 set_hudmessage(10,220,30,0.1,0.62,0,0.0,255.0,0.01,0.0,1)                 show_hudmessage(x,"Player: %s^nHP|AP: %i|%i",name,hp,ap)             }             else             {                 pev(target,pev_classname,classname,63)                 if(containi(classname,"monster_")>-1)                 {                     engfunc(EngFunc_InfoKeyValue,target,"is_player_ally",is_ally_str,7)                     engfunc(EngFunc_InfoKeyValue,target,"health",hp_str,15)                     engfunc(EngFunc_InfoKeyValue,target,"displayname",displayname,31)                     hp=str_to_num(hp_str)                     is_ally=str_to_num(is_ally_str)                     if(equali(classname,"monster_scientist")||equali(classname,"monster_barney"))                     {                         switch(is_ally)                         {                             case 1:                             {                                 is_ally=0                             }                             case 0:                             {                                 is_ally=1                             }                         }                     }                     switch(is_ally)                     {                         case 1:                         {                             set_hudmessage(5,175,235,0.1,0.62,0,0.0,255.0,0.01,0.0,1)                         }                         case 0:                         {                             set_hudmessage(240,115,5,0.1,0.62,0,0.0,255.0,0.01,0.0,1)                         }                     }                     show_hudmessage(x,"%s: %s^nHP: %i",ally_thingie[is_ally],displayname,hp)                 }                 else                 {                     SCPI_RemoveMsg(x)                 }             }         }         else         {             SCPI_RemoveMsg(x)         }     } }
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 12-16-2006 at 17:32.
Silencer123 is offline
 


Thread Tools
Display Modes

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:53.


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