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

The Commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-29-2017 , 13:48   The Commands
Reply With Quote #1

Hello, I am making (or creating) a plugin. It has lots of line more than 3000.
So I've gotta be careful to use correct codes. Firstly, I am using this includes;
Spoiler

And I want to ask all you some questions.

1) I want to delete hamsandwich. Because I don't like using hamsandwich.
I want to change it to fakemeta or reapi module. (I know reapi is not supported here)
Here are what I want to change

Spoiler


2) FM_Touch

Actually, It's not problem to use fm_touch. But I am not sure about it's the best.
What I should use in these codes?

Spoiler


3) set_lights

I don't use this due to I don't use engine include. So I use it usually.
I have a code I've just heard. Should I use this code instead of set_lights

Spoiler


4) find_ent_by_model

How can I use with fakemeta or reapi?
Is there any stock about it?

stock find_ent_by_model( .....)

Thanks for helping.
I am waiting for your answers

Last edited by PurposeLessx; 08-29-2017 at 14:20.
PurposeLessx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-29-2017 , 15:20   Re: The Commands
Reply With Quote #2

First of all script lines dosent matter how much they are.. You might have 3k lines can be optimized into 1000 line..
Second of all there is no lame using hamsandwich. Beside its the best module for dealing with entites..

Hooking register_touch is the best choice because the forward will be called just when every two players touch

About set lights both the same except you are calling a stock then calling to set the lights


About find entity by model
You need to loop throw all entities using engfunc_findentbystring theres alot of tutorials if you just search!
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-29-2017 , 19:26   Re: The Commands
Reply With Quote #3

I have thought so much about using register_touch.
It's in engine include but I just use fakemeta, reapi and %60 hamsandwich.
If I use FM_Think instead, Would I see any inequality?

And I am using this but I couldn't find what is default for it.
If I have made it "#OFF". I saw it was too bright.
PHP Code:
engfunc(EngFunc_LightStyle0lights); 

Last edited by PurposeLessx; 08-29-2017 at 19:29.
PurposeLessx is offline
kristi
Senior Member
Join Date: Nov 2016
Old 08-29-2017 , 19:46   Re: The Commands
Reply With Quote #4

Quote:
Originally Posted by PurposeLessx View Post
And I am using this but I couldn't find what is default for it.
If I have made it "#OFF". I saw it was too bright.
PHP Code:
engfunc(EngFunc_LightStyle0lights); 
PHP Code:
#include <engine>
set_lights("#OFF"); 
kristi is offline
Send a message via Skype™ to kristi
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-29-2017 , 20:22   Re: The Commands
Reply With Quote #5

  1. Don't obsess over lines of code.
  2. Don't try to remove a module just to reduce the number of modules. In many cases, you will end up writing worse/less efficient code if you do it for this reason.
__________________
fysiks is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-30-2017 , 04:55   Re: The Commands
Reply With Quote #6

Okay. I started using engine. I use "find_ent_by_owner & set_lights etc."
I have done my plugin. But If I bury players, they can unbury while pressing "Ctrl + Space".
Can I block using IN_DUCK and IN_JUMP while the player stucked & buried?
Thanks for helping
PurposeLessx 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 18:09.


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