Raised This Month: $ Target: $400
 0% 

Insolid players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-11-2007 , 15:46   Insolid players
Reply With Quote #1

Hi! I have this plugin (Is not working properly).Basically is working like this:*When a "id" is in another player(s) range that "id" and that that "players" got insolid ; else if outside of range "they" are solid again!*

Thanks...
Attached Files
File Type: sma Get Plugin or Get Source (invisible_range.sma - 705 views - 1.4 KB)
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 05-11-2007 at 15:53.
Alka is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 05-11-2007 , 16:04   Re: Insolid players
Reply With Quote #2

So it's like this:
1) Player A and player B are close to one another. fm_playerprethink() is called for player A, so player B becomes insolid.
2) Player B and player C are outside the range. fm_playerprethink() is called for player C, so player B becomes solid.

Try and find a workaround for this, or use server_frame(), tho I wouldn't do that if I were you
_Master_ is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-11-2007 , 16:10   Re: Insolid players
Reply With Quote #3

hmm....server_frame() is very laggy... ! there must be another way to do it
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 05-11-2007 , 16:13   Re: Insolid players
Reply With Quote #4

There is. A set_task() would do the job too.
_Master_ is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-11-2007 , 16:15   Re: Insolid players
Reply With Quote #5

how man?? i realy don't know...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 05-11-2007 , 20:39   Re: Insolid players
Reply With Quote #6

Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "Invisible Range" #define VERSION "1.0" #define AUTHOR "Alka" new radius = 200; public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR);         register_forward(FM_PlayerPreThink,"fm_playerprethink",0)     } public fm_playerprethink(id) {     static players[32], num, player     get_players(players, num,"a")             new distance, i;     new origin1[3], origin2[3];     get_user_origin(id, origin2);         for(i = 0; i < num; i++)     {         player = players[i]                 if(player != id)         {                         get_user_origin(player, origin1);             distance = get_distance(origin1, origin2);             /* Add code here to print out the distance */             if(distance < radius)             {                 set_pev(player, pev_solid, SOLID_NOT);                 fm_set_rendering(player, kRenderFxNone, 0, 0, 0, kRenderTransAdd, 50);                                 set_pev(id, pev_solid, SOLID_NOT);                 fm_set_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAdd, 50);                 i = 0;                 break;             }         }     }         if(i == num)     {                 set_pev(id, pev_solid, SOLID_BBOX);                 /* I'm not sure if fm_set_rendering has default values in it stock. If it does this will set the player back to default rendering*/         fm_set_rendering(id);     } } stock fm_set_rendering(ent, fx=kRenderFxNone, r=255, g=255, b=255, rend=kRenderNormal, amt=16) {     set_pev(ent, pev_renderfx, fx);         new Float:rendColor[3];     rendColor[0] = float(r);     rendColor[1] = float(g);     rendColor[2] = float(b);     set_pev(ent, pev_rendercolor, rendColor);         set_pev(ent, pev_rendermode, rend);     set_pev(ent, pev_renderamt, float(amt)); }

This is how I have my Kz plugin v0.09 no block code setup except for more distance checking.

Ps.. Are you only trying to set the SOLID_NOT and SOLID_BBOX only on person?
__________________
No private support via Instant Message
GunGame:SM Released

Last edited by teame06; 05-12-2007 at 16:55.
teame06 is offline
Send a message via AIM to teame06
_Master_
Senior Member
Join Date: Dec 2006
Old 05-12-2007 , 02:27   Re: Insolid players
Reply With Quote #7

I don't think that will work teame06.
Player A is "close" to player B and C. Player B and C are NOT "close". If fm_playerprethink() is called for Player A, your code will set SOLID_NOT ONLY to Player B, but not to Player C.

With that in mind I would suggest this in fm_playerprethink(id):
1) If <id> is solid then test if all other players are within range. If found at least one player then set <id> to be insolid.
2) If <id> is insolid then test if all other players are outside range. If found at least one player then set <id> to be solid.

This will solve the problem for <id> only, while the remaining players are not affected. This is not an issue as fm_playerprethink() will be called on them as well. The two suggestions stand true as, to some degree, distance(A, B)=distance(B, A).

Last edited by _Master_; 05-12-2007 at 02:39.
_Master_ is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 05-12-2007 , 02:39   Re: Insolid players
Reply With Quote #8

Quote:
Originally Posted by _Master_ View Post
I don't think that will work teame06.
Player A is "close" to player B and C. Player B and C are NOT "close". If fm_playerprethink() is called for Player A, your code will set SOLID_NOT ONLY to Player B, but not to Player C.
No, There more changes to that code I need to do. I still waiting for an answer from Alka. That if Alka wants to set the both players SOLID_NOT and change their rendering. Cause right now it only set the other player SOLID_NOT.

P.S. PreThink is just not called on one person. It still can go from Prethink(player C) -> Player A, PreThink(Player A) -> Player B, and even PreThink(Player B) -> Gaben. It still goes full circle for each player.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
_Master_
Senior Member
Join Date: Dec 2006
Old 05-12-2007 , 02:44   Re: Insolid players
Reply With Quote #9

Quote:
Originally Posted by Alka View Post
Basically is working like this:*When a "id" is in another player(s) range that "id" and that that "players" got insolid ; else if outside of range "they" are solid again
My guess is both <id> and players-in-range.
_Master_ is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-12-2007 , 03:13   Re: Insolid players
Reply With Quote #10

Thanks teame06! So i want when a Player A is close to a Player B both are get insolid! If a Player A is close to Player and Player C all are get insolid, and also for more players...!

"id" = player who prethink
"players" = others players remain

Later Edit:Thanks teame ,is working...but if E.g : In team Ct remain 1 player and in T team are 2 players /*Alive*/, player on team Ct is solid and transparent (weird)...and players from T are get tucked when walk...
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 05-12-2007 at 03:38.
Alka 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 06:35.


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