how would I write this plugin?
Im trying to change the value of an entity in my map to set to a value. Ive been trying to do this for a long time, cant figure it out.
I want a entity to set the value to turn on. the entity is a logic_branch "name1" i want it to "setvaluetest" "1" Or, another one i have is "logic_relay" "name2" to "trigger". The only way i can do this now is have a button in the map or turn on cheats and "ent_fire name1 setvaluetest 1" in console. |
Re: how would I write this plugin?
PHP Code:
|
Re: how would I write this plugin?
It is easier to edit the map and change what you want?
Regards. |
Re: how would I write this plugin?
You can do that if you want, but you could also do the changes via Stripper:Source instead. This is preferred since clients wouldn't need to redownload in this case.
|
Re: how would I write this plugin?
well i want to be able to turn it on and off since it controls things in the map. I'll try the code. Thanks
|
Re: how would I write this plugin?
Quote:
Then you have two different version of same map and will kick players if not match with server map. Edit map entitites with plugin or Stripper is easier and safely. Can also with small tool (EntSpy) but this can sometimes re-compile map without asking... And you need edit only one map what is on server. |
Re: how would I write this plugin?
But it told him to save with the same name, if the map is of himself, he creates a new version, one to one edition of his clan or something.
But passaarm modes that you guys are good too. Regards. |
Re: how would I write this plugin?
If you saved it with the same name, I'm pretty sure players would get a map differs error. But I tried the code and works great. Im wondering if its ok to run that code multiple times, eg. Im also getting an "Unknown Command" when i enter the command, though it still works.
Code:
/* Plugin Template generated by Pawn Studio */ |
Re: how would I write this plugin?
The Unknown Command thing is due to having no return on the commands(Most, if not all callbacks with the Action: tag need a return of some sort), just add return Plugin_Handled; after the while loops.
Example: PHP Code:
|
Re: how would I write this plugin?
If you find yourself writing the same code repeatedly, extract a method out of it... find the things that change, make them variables, then move the code to a method that takes those variables. For instance:
PHP Code:
I also included Tylerst's fix as noted in the previous post. |
All times are GMT -4. The time now is 10:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.