AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] Button IDs are Changing (https://forums.alliedmods.net/showthread.php?t=141178)

Stylaa 10-20-2010 13:55

[Solved] Button IDs are Changing
 
I coded a Plugin that opens the Jails in Jailbreak
but after 1 Day / RR The Button IDs are changed
lower or higher why are the Button IDs Changing?

How i can solve this Problem?

ConnorMcLeod 10-20-2010 14:35

Re: Button IDs are Changing
 
Because you may have added some plugins that create some entities at plugin_precache.
You should save buttons by model or target or something that won't change.

Stylaa 10-20-2010 15:04

Re: Button IDs are Changing
 
and how i get those values?

Exolent[jNr] 10-20-2010 15:14

Re: Button IDs are Changing
 
Code:
new szModel[ 32 ]; entity_get_string( iEntity, EV_SZ_model, szModel, charsmax( szModel ) ); new szTarget[ 32 ]; entity_get_string( iEntity, EV_SZ_target, szTarget, charsmax( szTarget ) );

For fakemeta, use pev() instead of entity_get_string() and change EV_SZ_* to pev_*.

Stylaa 10-20-2010 15:59

Re: Button IDs are Changing
 
so as Model it shows me

*27

How i can convert it back in Ent ingam and Press The Button manualy
PHP Code:

new buttonid
buttonid 
= ???
dllfuncDLLFunc_Usebuttonidid 


Exolent[jNr] 10-20-2010 16:07

Re: Button IDs are Changing
 
find_ent_by_model()

Stylaa 10-20-2010 16:11

Re: Button IDs are Changing
 
PHP Code:

new buttonid
buttonid 
find_ent_by_model(33,"weaponbox","models/w_scout.mdl")
dllfuncDLLFunc_Usebuttonidid 



Where to put the *27 ??

buttonid = find_ent_by_model(*27,"weaponbox","models/w_scout.mdl")

? Sorry i dont know this Funcktion so can you please explain me how i use it now?

Exolent[jNr] 10-20-2010 16:17

Re: Button IDs are Changing
 
http://www.amxmodx.org/funcwiki.php?...odel&go=search

To find an entity classname, it is a string from EV_SZ_classname (or pev_classname).

Stylaa 10-20-2010 16:47

Re: Button IDs are Changing
 
okay
But how i use now the Variable

( mysql_openbuttonid returns *62 )
PHP Code:

// if there are results found - ButtonID
    
mysql_openbuttonid SQL_ReadResult(Query1)
    
    new 
tmp find_ent_by_model ( -1"func_button""%s",  mysql_openbuttonid
    
mysql_openbuttonid tmp 


Exolent[jNr] 10-20-2010 17:25

Re: Button IDs are Changing
 
You have to read as a string.

Code:
new mysql_openbuttonid[10] SQL_ReadResult(Query, 1, mysql_openbuttonid, charsmax(mysql_openbuttonid))


All times are GMT -4. The time now is 10:21.

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