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

[Item]Helmet 1.0 + Files


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-22-2014 , 12:17   Re: [Item]Helmet 1.0 + Files
Reply With Quote #11

He mean:

1. What is the difference between this plugin and normal helmet
2. Why someone should install this, how is it useful ?
HamletEagle is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 05-22-2014 , 21:27   Re: [Item]Helmet 1.0 + Files
Reply With Quote #12

Normal helmet isn't realistic (I guess). Because this plugin gives you different helmet, you can buy and choose, you can set the health of the helmet. Also it will be realistic that the helmet will be dropped if you get a headshot.
__________________
What are you looking for here?
DavidJr is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-19-2016 , 07:26   Re: [Item]Helmet 1.0 + Files
Reply With Quote #13

  • new const MaxHelmet = 50;
    It will be better to allow unlimited helmets, look for dynamic arrays.

  • PHP Code:
    new cName[33][33];
    new 
    cModel[33][64];
    new 
    cSubModel[64];
    new 
    Float:cHealth[33];
    new 
    cCost[33]; 
    Some logical issues here. You set the max helmets to 50 but your arrays are only 33 cells. The 34rd helmet will create an index out of bounds error.
  • PHP Code:
    new szName[32], szModel[64], iSubModelFloat:flHealthiCost
    used only in LoadConfig. Why are this globals?
  • PHP Code:
    flAvelocity[0] -= flAvelocity[0] / 2;
        
    flAvelocity[2] -= flAvelocity[2] / 2
    If you divide in two both parts will be equal. Just do flAvelocity[0] = flAvelocity[0] / 2. Makes more sense. Just saying, doesn't really matter.
  • Make sure your entity is valid in fw_Touch.
  • You should really use charsmax(), formatex() not format(). Also, where you use sizeof() it's wrong. It should be sizeof -1, so charsmax.
  • In LoadConfig:
    • Your file is never closed.
    • if (!szLineData[0] || szLineData[0] == ';') continue; some issues here. If user put a space before the comment, your code will fail. To fix this, use trim() on szLineData.
    • new helmetIndex = 1; why do you start from 1? An array is indexed from 0, not 1.
    • szValue[0] != 0 for readability you should check != EOS, '^0' is the null terminator.
    • After all, szName, szKey are not needed. Copy szKey directly in cName[helmetIndex], etc. Also, notice I have said copy, not format. When you are not actually formatting and want only to copy a string into another, use copy() native.
    • countHelmet = helmetIndex; should be put after the while() loop.
    • It will be good to add some safety checks, like if the model really exists before precaching, if the strings you read are not empty, etc.
I just checked 2 or 3 of your functions and found enough issues to unapprove. If you want to support your plugin, PM me when you make some changes.
__________________

Last edited by HamletEagle; 04-19-2016 at 07:33.
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 16:31.


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