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

[BB] Addon: Ammo-Pack System v2.2 [API Shop, nVault Saving, AP Rewards and more!]


Post New Thread Reply   
 
Thread Tools Display Modes
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-12-2017 , 12:26   Re: [BB] Addon: Ammo-Pack System v2.2 [API Shop, nVault Saving, AP Rewards and more!]
Reply With Quote #21

A small review, i can be wrong about some, so let's discuss about them:

1. I think you could add 'these' to _:ItemData enumeration:
PHP Code:
new g_szAuthID[33][35], g_AP[33
Btw, szAuthId should be 34 not 35.

2. Here
PHP Code:
public plugin_end()
{
    for( new 
Players 1Players <= get_maxplayers(); Players++ )
        
save_ap(Players)

    
nvault_close(g_Vault)

You should use get_players()

3. Your clcmd_say() function is not need , just register directly register_clcmd("say /donat .... and skip su much checks.

4. In save_ap don't use formatex() they are already strings, just use directly them.

5. In load_ap you use get_auth insteand of get_user_authid, i'm asking if is not a mistake? Also same problem, remove formatex() and use directly the string, it is pointless.
EDIT: Now i see, your get_auth() is a function typed by cvar, why is that? Why you don't save just for steam and that's all ?

6. In your register native functions, you don't have to make variables if you use just once the natives, example:
PHP Code:
public native_set_user_apIndexiAmount)
{
    new 
id get_param(1)
    
    new 
Amount get_param(2)
    
    
g_AP[id] = Amount

- >

PHP Code:
public native_set_user_apPluginParams)
{    
    
g_AP[get_param(1)] = get_param(2)

If you use them just once is pointless to insert is value in variables.

Last edited by Craxor; 06-12-2017 at 12:27.
Craxor is offline
Send a message via ICQ to Craxor
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-12-2017 , 16:16   Re: [BB] Addon: Ammo-Pack System v2.2 [API Shop, nVault Saving, AP Rewards and more!]
Reply With Quote #22

Actually steam id maximum length is 32 chars


Btw its better to save players ammopacks once you set/changed them so save player ap in native_set_user_ap( Index, iAmount) function instead of plugin end event.
__________________
@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
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-13-2017 , 01:35   Re: [BB] Addon: Ammo-Pack System v2.2 [API Shop, nVault Saving, AP Rewards and more!]
Reply With Quote #23

Not if he using also in other pats ( regarded do saving the amo ) ... then he would need to use his own natives in his own plugin wich is a poor way of doing things.
Craxor is offline
Send a message via ICQ to Craxor
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-13-2017 , 03:05   Re: [BB] Addon: Ammo-Pack System v2.2 [API Shop, nVault Saving, AP Rewards and more!]
Reply With Quote #24

I didnt checked the plugin but it seems its very bad coded.
__________________
@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
crnova
Senior Member
Join Date: Sep 2015
Old 07-15-2017 , 17:21   Re: [BB] Addon: Ammo-Pack System v2.2 [API Shop, nVault Saving, AP Rewards and more!]
Reply With Quote #25

I've made this a year ago while i was still a beginner, i'll be updating this later in the future
__________________

Last edited by crnova; 07-15-2017 at 17:24.
crnova 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 00:18.


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