Raised This Month: $ Target: $400
 0% 

possible to do these?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 12-12-2007 , 15:18   Re: possible to do these?
Reply With Quote #2

Right.

1) Remove buyzones is my suggestion.
What you need to do is to loop through each entity that is a "func_buyzone" and kill it.

Code:
    new ent ;     // create our "entity" variable.     // this will hold the currently looked at entity     while ( ( ent = ( engfunc(EngFunc_FindEntityByString,ent,"classname","func_buyzone")) ) )     //keep setting ent to the next entity that is called func_buyzone, for as long as there are more     {         engfunc(EngFunc_RemoveEntity,ent) ;         // and kill this entity     }
Call that on map start, so plugin_init or w/e.
(I think ... don't trust that last statement)

2) Register the "touch" event between the player and the gun, and return FMRES_SUPERCEDE to block it:

Code:
public plugin_init()    {     // during our initialisation function     register_forward(FM_Touch,"on_touch",0)     // register the "touch" event to a function (that we wrote) called on_touch     // whenever two bodies touch, this function will be called } public on_touch(id,ent) {   if ( !is_user_connected(id) || !pev_valid(ent))     // if "id" is not a player, or "ent" is not an entity (object) quit         return FMRES_IGNORED ;         static classname[32] ;     // create a classname variable     // "static" means use the same variable every time the function is called     pev(ent,pev_classname,classname,sizeof classname - 1 )     // get ent's classname     if ( ( ! equal(classname,"weapon",6) ) && ( !equal(classname,"armoury",7) ) )     // if it doesn't start "weapon" or "armoury", we don't care         return FMRES_IGNORED ;         return FMRES_SUPERCEDE ;     // this means "block the event" }

To make someone invisible, you need to set their rendering, and specify the "alpha" as anything < 255.
Code:
set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, ALPHA [e.g. 30])

If you need any comments explaining any of the code just ask.
If I don't pick it up, someone else should.

Last edited by purple_pixie; 12-14-2007 at 06:38.
purple_pixie is offline
 



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 11:12.


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