AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   DispatchKeyValue (https://forums.alliedmods.net/showthread.php?t=17650)

MichielM 09-05-2005 17:42

DispatchKeyValue
 
i saw somebody used code to edit the function of a door. i only dont know how this actualy works, so maybe someone can give me a little help.

im running a rp mod (harbu) on the map mecklenburg_final. now when i start the server i notice that all the doors that should be closed, are open.
i know there is a way to edit the function, i only dont know how to code it.

this is wat i saw someone use it to edit the function
Code:
new doorentbuf = get_maxplayers()     new dinerdoor = 282 + doorentbuf DispatchKeyValue(dinerdoor, "spawnflags", "32") DispatchKeyValue(dinerdoor, "movesnd", "9") DispatchKeyValue(dinerdoor, "wait", "-1") DispatchKeyValue(dinerdoor, "doormaterial", "1") DispatchSpawn(dinerdoor) set_entity_health(dinerdoor,-10000.0)
now this code should edit the "dinnerdoor" with the entid "282" ??
how can i say that the door has to be closed on server start?
also when i make a "new hospitaldoor" as example, it says "Hospital is never used before" of whatever :?

MichielM 09-06-2005 13:09

nobody knows?

TotalNoobScripter 09-06-2005 23:17

282 is the ent id without players right? if thats so, it should work.

Hawk552 09-06-2005 23:21

Re: DispatchKeyValue
 
Quote:

Originally Posted by MichielM
i saw somebody used code to edit the function of a door. i only dont know how this actualy works, so maybe someone can give me a little help.

im running a rp mod (harbu) on the map mecklenburg_final. now when i start the server i notice that all the doors that should be closed, are open.
i know there is a way to edit the function, i only dont know how to code it.

this is wat i saw someone use it to edit the function
Code:
new doorentbuf = get_maxplayers()     new dinerdoor = 282 + doorentbuf DispatchKeyValue(dinerdoor, "spawnflags", "32") DispatchKeyValue(dinerdoor, "movesnd", "9") DispatchKeyValue(dinerdoor, "wait", "-1") DispatchKeyValue(dinerdoor, "doormaterial", "1") DispatchSpawn(dinerdoor) set_entity_health(dinerdoor,-10000.0)
now this code should edit the "dinnerdoor" with the entid "282" ??
how can i say that the door has to be closed on server start?
also when i make a "new hospitaldoor" as example, it says "Hospital is never used before" of whatever :?

You can't just say "new hospitaldoor", you need to spawn it. And yes, dinnerdoor is 282 + maxplayers, because for each player, every other ent is pushed up 1 id.

And you can just do force_use.

TotalNoobScripter 09-06-2005 23:24

i thought his "new hospitaldoor" was refering to the code for creating a new varible. lol

well i was assuming that he was setting those other keyvalues to do other things then just lock it, but if that is what hes doing then yea, force_use it.

Hawk552 09-06-2005 23:26

Quote:

Originally Posted by TotalNoobScripter
i thought his "new hospitaldoor" was refering to the code for creating a new varible. lol

well i was assuming that he was setting those other keyvalues to do other things then just lock it, but if that is what hes doing then yea, force_use it.

Well honestly I don't know the keyvalue to spawn it closed, so I wouldn't be able to say to use anything other than force_use. Just wait until someone like Avalanche comes along.

TotalNoobScripter 09-06-2005 23:28

wait -1 should make it close 4ever until its changed again, movesnd is the value for the defualt hl sound that is played when the door is opened, i forgot the other 2 flags.

XxAvalanchexX 09-07-2005 01:31

If your spawnflags is already even, add 1 to it for it to start open (or closed based on how the door was created), and if it is odd then it should already have that flag. If it has that flag and you don't want it to subtract 1 from the spawnflags.

Anyway, use force_use.

MichielM 09-07-2005 16:52

alraight! thanx for the respond..think í can fix it now.
anyways what do u guys mean with force_use, and how do i use it:?

Hawk552 09-07-2005 17:06

[small]

public whateverfunction()
{
force_use(1,whatevertheentidis)
}


All times are GMT -4. The time now is 14:26.

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