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

code improve


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arnalll
Member
Join Date: Nov 2015
Location: France
Old 12-08-2017 , 10:16   code improve
Reply With Quote #1

hi all,
i want to improve my flying blades plugin for DoD.

This plugin add a secondary attack to knife or spade that throw the blades over.

In this one the plugin ham secondary attack. But for all entities involved (there are 3 knives in DoD) i copy paste the functions.

i want to lower the code, it is easy for hooking secondary attack but i need it to show correct deathmessages above weapon used.

credits for the code goes to "GordonFreeman and Gauss" since i just port it to DoD.

thanks in advance... i may ask help also for an additon of this gameplay type that use "i know kung fu" from Hawk! Literally when you throw your knife or spade youre able to do kungfu moves with player models animations of kung fu. That ofc makes damages.

kind regards
Attached Files
File Type: sma Get Plugin or Get Source (fly_blades_lite3.sma - 463 views - 15.0 KB)
arnalll is offline
arnalll
Member
Join Date: Nov 2015
Location: France
Old 01-20-2018 , 07:44   Re: code improve
Reply With Quote #2

omg still no one ! bump is useless !!
arnalll is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2018 , 09:43   Re: code improve
Reply With Quote #3

Since you have no knowledge in Pawn, you have to post in Requests section, Scripting section requires basic scripting knowledge.
__________________
edon1337 is offline
arnalll
Member
Join Date: Nov 2015
Location: France
Old 01-20-2018 , 09:51   Re: code improve
Reply With Quote #4

since you dont know if i have no knowledge in Pawn ...
arnalll is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2018 , 10:07   Re: code improve
Reply With Quote #5

Quote:
Originally Posted by arnalll View Post
since you dont know if i have no knowledge in Pawn ...
Since you do, then why are you asking for others to improve your code?
__________________
edon1337 is offline
arnalll
Member
Join Date: Nov 2015
Location: France
Old 01-20-2018 , 10:16   Re: code improve
Reply With Quote #6

ok it cant be improved... btw i guess you didnt even read it
arnalll is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2018 , 10:24   Re: code improve
Reply With Quote #7

Quote:
Originally Posted by arnalll View Post
ok it cant be improved...
Oh yes it can.

1.
PHP Code:
get_cvar_num"fly_blades" 
Use PCvars instead.
2. Don't use Fakemeta Util.
3. Indent your code.
__________________

Last edited by edon1337; 01-20-2018 at 10:24.
edon1337 is offline
arnalll
Member
Join Date: Nov 2015
Location: France
Old 01-20-2018 , 11:05   Re: code improve
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
Oh yes it can.

1.
PHP Code:
get_cvar_num"fly_blades" 
Use PCvars instead.
2. Don't use Fakemeta Util.
3. Indent your code.
very usefull and what to change fakemeta?
arnalll is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-20-2018 , 11:16   Re: code improve
Reply With Quote #9

Quote:
Originally Posted by arnalll View Post
very usefull and what to change fakemeta?
He said fakemeta_UTIL, not fakemeta. They are NOT the same thing. Use the proper natives from the other modules. For example:
fm_set_rendering -> set_user_rendering(fun module)
fm_entity_set_model -> EngFunc_SetModel(fakemeta)
fm_create_entity -> create_entity(engine)
__________________
HamletEagle is online now
arnalll
Member
Join Date: Nov 2015
Location: France
Old 01-20-2018 , 12:13   Re: code improve
Reply With Quote #10

i am glad to have at last some answers!
arnalll 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 13:20.


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