Raised This Month: $32 Target: $400
 8% 

CS Knife


Post New Thread Reply   
 
Thread Tools Display Modes
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-06-2014 , 09:51   Re: CS Knife
Reply With Quote #11

Not working when i write /knife show me 1-Seal Knife and 0-Exit
ArabicMan is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-06-2014 , 09:52   Re: CS Knife
Reply With Quote #12

Have you put cs_knife.ini in configs?
__________________
What are you looking for here?
DavidJr is offline
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-06-2014 , 10:07   Re: CS Knife
Reply With Quote #13

Quote:
Originally Posted by DavidJr View Post
Have you put cs_knife.ini in configs?
I was forget it now it's works fine but in commands say knife in chat not work. Add messages when i try buy it and i don't have money print message in chat say that you haven't money to buy this knife. Also make the price (ex: 1000$) color in menu yellow or red that will be much better.

Last edited by ArabicMan; 06-06-2014 at 10:16. Reason: Color ADD.
ArabicMan is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-06-2014 , 10:14   Re: CS Knife
Reply With Quote #14

Quote:
Originally Posted by ArabicMan View Post
I was forget it now it's works fine but in commands say knife in chat not work.
It works fine in me.

Quote:
Originally Posted by ArabicMan View Post
Add messages when i try buy it and i don't have money print message in chat say that you haven't money to buy this knife. Also make the price (ex: 1000$) color in menu yellow or red that will be much better.
Thank you, I'll add it asap.
__________________
What are you looking for here?
DavidJr is offline
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-06-2014 , 10:26   Re: CS Knife
Reply With Quote #15

Quote:
Originally Posted by DavidJr View Post
It works fine in me.
I test it many times say /knife and in team say /knife works fine but knife in chat and team say not work try it again to see.
ArabicMan is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-06-2014 , 10:33   Re: CS Knife
Reply With Quote #16

What do you mean knife in chat? The commands just look like these:

PHP Code:
    register_clcmd("say /knife""ClCmd_Menu");
    
register_clcmd("say_team /knife""ClCmd_Menu");
    
register_clcmd("knife""ClCmd_Menu"); 
__________________
What are you looking for here?
DavidJr is offline
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-06-2014 , 10:40   Re: CS Knife
Reply With Quote #17

Quote:
Originally Posted by DavidJr View Post
What do you mean knife in chat? The commands just look like these:

PHP Code:
    register_clcmd("say /knife""ClCmd_Menu");
    
register_clcmd("say_team /knife""ClCmd_Menu");
    
register_clcmd("knife""ClCmd_Menu"); 
Sorry i was write it in chat not console. It works fine in CONSOLE.
ArabicMan is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-11-2015 , 14:13   Re: CS Knife
Reply With Quote #18

As BackStabNoob pointed this is different from his API. API requiere a coder to make the knife, while this allow the end user to make his own knives so I won't mind having both of them, but before some things needs to be fixed:

1.Instead of CurWeapon event use Ham_Item_Deploy. To get weapon csw index from weapon ent index use cs_get_weapon_id.
2.In OnCBase_WpnPrimaryAttack_Pre and OnCBase_WpnSecondaryAttack_Pre make sure the entity is valid before doing something. Also checking the weapon index is reduntant, you already registered the hook only for knife.
3.In task_DelayAttack:
  • checking trFraction two times seems weird, just put Play_EmitSound in the first check.
  • get_maxplayers should be cached in a place like init, because it will never change during run time.
  • you are freeing an empty trace handle: free_tr2(hTrace)
4.In ClCmd_Menu:
  • PHP Code:
    equal(cName[i], ""
    . Checking like this should be enough: !cName[i]
  • Do not create variables inside loop
  • Use formatex, not format if you are not formatting into the same buffer from where you get values. It's faster.
5.Give_Weapon is just a dummy function which should be removed, call directly Set_Weapon
6.
PHP Code:
new szWpnName[32];
    
get_weaponname(CSW_KNIFEszWpnNamesizeof szWpnName 1); 
Really ? You already know it's weapon_knife.
7.Don't use fakemeta_util in plugins, use it only for learning purpose. Instead of it you should use functions from engine/fun/fakemeta/cstrike etc. So, instead of fm_give_item use give_item.
8.The trace from Draw_ScratchDecal is already empty so you should not free it again.
9.In LoadWpnConfig:
  • When dealing with strings use charsmax() instead sizeof - 1 for readability.
  • PHP Code:
    fgets(szFileszLineDatasizeof szLineData
    that's wrong, you forgot to substract -1, but as I said, use charsmax.
  • PHP Code:
    replace(szLineDatasizeof szLineData 1"^n"""); 
    it's not needed.
  • You should trim szLineData before working with it, that way you will remove empty unneded spaces. Without this your check can fail: szLineData[0] == ';'
  • I am not sure to like much your file parsing method, but that's something to see later.

A suggestion would be to do not limit the user to only 32 knives, you could use dynamic arrays to store the content of the file.

You should start with this, later we'll check in deep every function.
__________________

Last edited by HamletEagle; 09-11-2015 at 14:41.
HamletEagle is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-26-2015 , 12:44   Re: CS Knife
Reply With Quote #19

15 days have passed and I don't see any changes from the author. Since section needs to be cleaned I'll unapprove this for now, but don't worry, your plugin can be reviewed at any time. PM a plugin approver after you made the changes.
__________________
HamletEagle 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 21:00.


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