Raised This Month: $ Target: $400
 0% 

Constant button used


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
katna
Senior Member
Join Date: May 2010
Old 09-01-2011 , 09:40   Constant button used
Reply With Quote #1

how can i check if a specific button is used, i mean first i tried with button id but then i found out that button id are not permanent. Also i checked targetname but some buttons doesn't have a targetname. Any idea?
katna is offline
katna
Senior Member
Join Date: May 2010
Old 09-27-2011 , 08:41   Re: Constant button used
Reply With Quote #2

bump
katna is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-27-2011 , 09:06   Re: Constant button used
Reply With Quote #3

Find by model?
__________________
Bugsy is offline
katna
Senior Member
Join Date: May 2010
Old 09-27-2011 , 09:14   Re: Constant button used
Reply With Quote #4

I don't think this is a good idea because there is many buttons on the map with the same model, and i need specific one.
katna is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-27-2011 , 09:23   Re: Constant button used
Reply With Quote #5

I used model for my bombsite lock plugin. Determine the model for your button then see if there is more than one.
__________________
Bugsy is offline
katna
Senior Member
Join Date: May 2010
Old 09-27-2011 , 09:28   Re: Constant button used
Reply With Quote #6

I understand your idea to check models, but if there is more than one then what do you suggest to do?

anyway I'm trying to save specific button for every map in a .ini file and then check if any of them were in the last then do 'something'.
katna is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-27-2011 , 09:41   Re: Constant button used
Reply With Quote #7

Find out the model of the exact one you want to manipulate. You can then do this for all maps that you wish to support and make a list. Or you can find out in which order each are spawned.
__________________
Bugsy is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-27-2011 , 21:02   Re: Constant button used
Reply With Quote #8

Targetname, Entity ID, approximate origin, spawn order... any of these can be used to separate clones from the button you want to check.

I don't know if entity ID will change after a mapchange ... you should test, create a 2 slot server, start the map, see the entity id of that button, remember it, close the server, start a 32 slot server on the same map and see the entity id of that same button.
__________________
Hunter-Digital is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 09-27-2011 , 23:17   Re: Constant button used
Reply With Quote #9

you have to use Hack, here:

Code:
// global var
    new button_id

// add this when loading .ini file
    // every time you create a button entity
    // new ent = create_entity("BUTTON")
    button_id++
    entity_set_int(ent, EV_INT_iuser1, button_id)  // engine
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216
D.Moder 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 22:37.


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