This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Entitys Prob


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
@omik][Fusion
Member
Join Date: Nov 2005
Location: Killeen,Tx
Old 01-08-2006 , 03:02   Entitys Prob
Reply With Quote #1

Ok...heres the code I have so far *Thanks to Suicide for getting me started in the right direction*
Code:
#include <amxmodx> #include <engine> #include <fun> #define PLUGIN "No Block" #define VERSION "0.1" #define AUTHOR "AtomikFusion" public plugin_init()     {     register_plugin(PLUGIN, VERSION, AUTHOR) } public pfn_touch(ptr , ptd) //ptr = the toucher and ptd = the touched     {     new szToucher[32] , szTouched[32]         get_user_name(ptr , szToucher , 31)     get_user_name(ptd , szTouched , 31)         if(is_user_alive(ptr)  && is_user_alive(ptd))//You use this so you know that a player has touched a player.         {         if( get_user_team(ptr) == get_user_team(ptd) ) //You use this to know that the toucher/touched are on the same team from now on.             {             //Use whatever you would like to do to the players here.                client_print( 0 , print_chat , "** %s blocked %s, %s has NO-CLIP to move" , szToucher , szTouched, szTouched)                 if(get_user_noclip(ptd) == 0)                 {                 set_user_noclip(ptd, 1)             }             else if(get_user_noclip(ptd) == 1)                 {                 client_print(0, print_chat, "** %s Has CLIP again", szTouched)                                 set_user_noclip(ptd)             }         }     } }

It works for the part of setting no clip to the players when they touch each other. Here are my problems
1. It sets no clip to both ptr and ptd
2. Once no clip is set, it does not reset it back(you have to run into ur teammate a couple more times)
3. I cant seem to figure out how to stop the touch call when i try to stand on top of my teammates.

So far it works and compiles with no errors. The touch call only gets activated when you touch ur own teammates. Can anyone help please? Also...if anyone can point me in the direction of how to change hosties models in cz i would appreciate it. I've looked at hostitron but it doesnt work with cz. Thanks
@omik][Fusion is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-08-2006 , 10:54  
Reply With Quote #2

I did it here somewhere, just don't steal it and release this as your own plugin or something.

Code:
/* Surf Tools - Extras by Hawk552 Description: More features to go along with the original surf tools plugin. Features: - Removing the "BOOM" button in surf maps - Removing weapons from spawn, and not allowing sniping from spawn point - Removing all weapons entirely Credits: Thanks to Freecode for a section that has been removed (basically thanks for him trying) Designed to work with Surf Management / Tools - Base, although it can work on its own. */ /************************************************************************** Changelog: 1.0 - Original Release 1.1 - Fixed button remover, abandoned passthrough 1.2 - Removed gun being useless, added gun removal, as well as HP setter 1.3 - Fixed spawn HP, added semiclip **************************************************************************/ #include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #define PLUGIN "Surf Management / Tools - Extras" #define VERSION "1.3" #define AUTHOR "Hawk552" public plugin_init() {     checksurf();         register_plugin(PLUGIN,VERSION,AUTHOR);         register_cvar("surf_version_extras",VERSION,FCVAR_SERVER);         register_cvar("surf_rembutton","1");     register_cvar("surf_noguns","2");     register_cvar("surf_spawn_dist","500");     register_cvar("surf_hp","1124");     register_cvar("surf_semiclip","1");         register_event("ResetHUD","check_hp","be");     register_event("Damage","check_hp","b");         if(!cvar_exists("surf_on"))     {         register_cvar("surf_on","1");     }         //Uncomment this if the button re-appears after the first round.     //register_event("RoundTime", "check_button", "bc")         check_button(); } public check_button() {     if(get_cvar_num("surf_rembutton") && get_cvar_num("surf_on"))     {         new ent;         while((ent = find_ent_by_class(ent,"func_button"))!=0)         {             remove_entity(ent);         }         while((ent = find_ent_by_class(ent,"func_rot_button"))!=0)         {             remove_entity(ent);         }     }     return 0; } public pfn_touch(ptr,ptd) {     if(!get_cvar_num("surf_on") || !ptr || !ptd)     {         return 0;     }         new pToucherClassname[64];     new pTouchedClassname[64];         entity_get_string(ptr,EV_SZ_classname,pToucherClassname,63);     entity_get_string(ptd,EV_SZ_classname,pTouchedClassname,63);         if(equali(pToucherClassname,"trigger_hurt") || equali(pTouchedClassname,"trigger_hurt") && get_cvar_num("surf_hp"))     {               if(is_user_alive(ptr) && !is_user_bot(ptr))         {             user_kill(ptr,0);         }         else if(is_user_alive(ptd) && !is_user_bot(ptd))         {             user_kill(ptd,0);         }     }         return 0; } public checksurf() {     new mapname[64];     get_mapname(mapname,63);     if(!(containi(mapname,"surf") != -1 || containi(mapname,"wurf_") != -1 || equali(mapname,"tentical")))     {         // Yeah I tried to make it plugin independant, oh well         set_cvar_num("surf_on",0);     }     return 0; } public client_PreThink(id) {     if(!is_user_alive(id) || !get_cvar_num("surf_on"))     {         return 0;     }         if(get_cvar_num("surf_noguns") == 1)     {         new spawndist = get_cvar_num("surf_spawn_dist");                 new Float:origin[3];         entity_get_vector(id,EV_VEC_origin,origin);             new dm_id = find_ent_by_class(-1,"info_player_deathmatch");         new st_id = find_ent_by_class(-1,"info_player_start");             new Float:dm_origin[3];         entity_get_vector(dm_id,EV_VEC_origin,dm_origin);         new Float:st_origin[3];         entity_get_vector(st_id,EV_VEC_origin,st_origin);             new Float:dm_dist = get_distance_f(origin,dm_origin);         new Float:st_dist = get_distance_f(origin,st_origin);             new clip, ammo;         new weap = get_user_weapon(id,clip,ammo);                 if(dm_dist < spawndist || st_dist < spawndist)         {                   if(weap != CSW_KNIFE && weap != CSW_C4 && weap != CSW_HEGRENADE && weap != CSW_FLASHBANG && weap != CSW_SMOKEGRENADE)             {                 client_cmd(id,"drop");             }         }         else if(dm_dist > spawndist || st_dist > spawndist)         {             if(weap == CSW_KNIFE)             {                 give_item(id,"weapon_scout");             }         }     }     else if(get_cvar_num("surf_noguns") == 2)     {               new clip, ammo;         new weap = get_user_weapon(id,clip,ammo);                     if(weap != CSW_KNIFE && weap != CSW_C4 && weap != CSW_HEGRENADE && weap != CSW_FLASHBANG && weap != CSW_SMOKEGRENADE)         {             client_cmd(id,"drop");         }     }     else if(get_cvar_num("surf_noguns") == 3)     {         new clip, ammo;         new weap = get_user_weapon(id,clip,ammo);                     if(weap != CSW_KNIFE && weap != CSW_C4)         {             strip_user_weapons(id);             give_item(id,"weapon_knife");         }     }         if(get_cvar_num("surf_semiclip"))     {         new Float:porigin[3], ent, bool:entflag, Float:radius = 150.0;         entity_get_vector(id,EV_VEC_origin,porigin);                 while((ent = find_ent_in_sphere(ent,porigin,radius)) != 0)         {             if(!is_user_alive(ent) || ent == id)             {                 continue;             }                         entflag = true;                         break;         }                 if(!entflag)         {             entity_set_int(id,EV_INT_solid,2);         }         else if(entflag)         {                       entity_set_int(id,EV_INT_solid,0);         }     }         return 0; } public check_hp(id) {     if(!get_cvar_num("surf_on"))     {         return 0;     }         new cvar_hp = get_cvar_num("surf_hp");         if(cvar_hp == 0 || !is_user_alive(id))     {         return 0;     }         new damage = read_data(2), attacker = get_user_attacker(id);     new atk_class[32];     entity_get_string(attacker,EV_SZ_classname,atk_class,31);         if(equali(atk_class,"player") && get_user_health(id) < cvar_hp)     {         set_user_health(id,cvar_hp);     }     else if(damage > 100)     {         user_kill(id,0);     }         return 0; }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
@omik][Fusion
Member
Join Date: Nov 2005
Location: Killeen,Tx
Old 01-08-2006 , 14:01   Re: Entitys Prob
Reply With Quote #3

Thanks for trying hawk...your plugin deals mostly with surf. What im trying to do is make a plugin that allows you to walk through ONLY ur teammates when they touch/collide. Im trying to do this bcuz im tired of sissy players crowding the back end of the door trying to steal kills while the real players are fighting the real fight. At least this way ur teammate being there wont matter and the sissys can die instead. Like i said it compiles with no errors and works for the most part i just cant figure these out
Quote:
1. It sets no clip to both ptr and ptd
2. Once no clip is set, it does not reset it back(you have to run into ur teammate a couple more times)
3. I cant seem to figure out how to stop the touch call when i try to stand on top of my teammates.
Thanks again
@omik][Fusion is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-08-2006 , 14:21  
Reply With Quote #4

That's what it is... read the stuff about semiclip, it's near the end of PreThink.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
@omik][Fusion
Member
Join Date: Nov 2005
Location: Killeen,Tx
Old 01-08-2006 , 14:51  
Reply With Quote #5

Ahhhh I found it. How would i integrate that into the pfn_touch? Or would i have to rewrite it to client_prethink? And im assuming i would have to register the cvar as u did. Ill try to figure out while i wait for a response and some more help....Thanks by the way, I really appreciate it.
@omik][Fusion is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-08-2006 , 14:56  
Reply With Quote #6

I tried integrating it into pfn_touch a while ago (which failed horribly).

The best result I got was in client_PreThink, so you should probably write it into that.

Here's one of the early generation ones I did, which is, like I said, one of the ones that failed horribly:

Code:
#include <amxmodx> #include <engine> #include <fun> new bool:surfmap = false public plugin_init()     {     new surftrue = check_surf()     if(surftrue == 1)         {         surfmap = true     }     register_plugin("Surf Passthrough","1.0","Hawk552")     register_cvar("surf_passthrough","1") } stock check_surf()     {     new mapname[64]     get_mapname(mapname,63)     if(containi(mapname,"surf_")!=-1)         {         return 1     }     return 0 } /* public pfn_touch(ptr,ptd)     {     if(ptd == 0 || ptr == 0)     {         return PLUGIN_CONTINUE     }         if(is_user_connected(ptr) && is_user_alive(ptr))         {         if(surfmap == false)             {             return PLUGIN_CONTINUE         }                 if(get_cvar_num("surf_passthrough")==0)             {             return PLUGIN_HANDLED         }                 new classname[64]         entity_get_string(ptd,EV_SZ_classname,classname,63)                 if(containi(classname,"trigger_")!=-1)             {             return PLUGIN_CONTINUE         }         else         {                         entity_set_int(ptr,EV_INT_solid,SOLID_TRIGGER)                     }     }     return PLUGIN_CONTINUE } */ public pfn_touch(ptr,ptd) {     if(ptr > 0 && ptd >= 0)     {         if(is_user_connected(ptr) && is_user_alive(ptr))         {             if(surfmap == false)                 return PLUGIN_CONTINUE         }                 if(get_cvar_num("surf_passthrough")==0)             return PLUGIN_CONTINUE                 new classname[64]         entity_get_string(ptd,EV_SZ_classname,classname,63)                 if(containi(classname,"trigger_"))             entity_set_int(ptr,EV_INT_solid,SOLID_TRIGGER)                 }     return PLUGIN_CONTINUE }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
@omik][Fusion
Member
Join Date: Nov 2005
Location: Killeen,Tx
Old 01-08-2006 , 15:39  
Reply With Quote #7

Ok Hawk, thanks to you it works BUT...Everyone gets no clipping. I liked the pfn_touch because it was able to determine if players where teammates or not. Heres what i got
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #define PLUGIN "No Block" #define VERSION "0.1" #define AUTHOR "AtomikFusion With Credits to Hawk552 And Suicide" public plugin_init()     {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("semi_clip", "1") } public client_PreThink(id)     {     if(get_cvar_num("semi_clip"))         {         new Float:porigin[3], ent, bool:entflag, Float:radius = 150.0;         entity_get_vector(id,EV_VEC_origin,porigin);                   while((ent = find_ent_in_sphere(ent,porigin,radius)) != 0)             {             if(!is_user_alive(ent) || ent == id)                 {                 continue;             }                           entflag = true;                           break;         }                   if(!entflag)             {             entity_set_int(id,EV_INT_solid,2);         }         else if(entflag)             {                         entity_set_int(id,EV_INT_solid,0);         }     }     return 0; }
Thanks to you like i said it works. But how can i determine if people are teammates? Im guessing along the lines of using pfn_touch to determine the teams then forwarding it to the client prethink. IDK...Do you think it will work? Thanks for all the help so far...BTW...you got msn?
@omik][Fusion is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-08-2006 , 15:56  
Reply With Quote #8

Code:
if(!is_user_alive(ent) || ent == id || get_user_team(id) != get_user_team(ent))

Also, you might have to decrease the radius. If more than 1 person is in the radius and 1 is a teammate but the other is not, it'll still be activated.

pfn_touch I found was too slow though. It works but it looks terrible and you glitch when hitting someone.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
@omik][Fusion
Member
Join Date: Nov 2005
Location: Killeen,Tx
Old 01-08-2006 , 15:58  
Reply With Quote #9

thanks hawk ill give that a try...i gotta go do some things so i wont respond for a while...but im learning new stuff so hope to hear from you and ill let you know how it goes thanks
@omik][Fusion is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-08-2006 , 16:05  
Reply With Quote #10

Oops, change that to get_user_team(id) != get_user_team(ent).
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 02:12.


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