Raised This Month: $51 Target: $400
 12% 

DispatchKeyValue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MichielM
Member
Join Date: Aug 2005
Old 09-05-2005 , 17:42   DispatchKeyValue
Reply With Quote #1

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 is offline
MichielM
Member
Join Date: Aug 2005
Old 09-06-2005 , 13:09  
Reply With Quote #2

nobody knows?
MichielM is offline
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 09-06-2005 , 23:17  
Reply With Quote #3

282 is the ent id without players right? if thats so, it should work.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-06-2005 , 23:21   Re: DispatchKeyValue
Reply With Quote #4

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 09-06-2005 , 23:24  
Reply With Quote #5

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.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-06-2005 , 23:26  
Reply With Quote #6

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 09-06-2005 , 23:28  
Reply With Quote #7

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.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-07-2005 , 01:31  
Reply With Quote #8

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.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
MichielM
Member
Join Date: Aug 2005
Old 09-07-2005 , 16:52  
Reply With Quote #9

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
MichielM is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-07-2005 , 17:06  
Reply With Quote #10

[small]

public whateverfunction()
{
force_use(1,whatevertheentidis)
}
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 16:14.


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