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

[GunXP] Prestige Shop 1.1


Post New Thread Reply   
 
Thread Tools Display Modes
kristi
Senior Member
Join Date: Nov 2016
Old 02-23-2017 , 13:16   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #11

Quote:
Originally Posted by edon1337 View Post
Unapproved.
kristi is offline
Send a message via Skype™ to kristi
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 02-23-2017 , 13:33   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #12

Quote:
Originally Posted by edon1337 View Post
1. dproto installed.
2. Using Fakemeta Util is wrong.
3. Use style 0 of natives.
4. You can create
PHP Code:
new PrestigeCost 
before switch so you don't need to create it many times.
5.
PHP Code:
for(id 1id <= get_maxplayers(); id++) { 
Cache get_maxplayers on plugin_init.
6.
PHP Code:
if(is_user_alive(id) && is_user_connected(id)) 
No need to check is_user_connected.
7. Use nVault for saving.
8. Why are you using a HudMessage stock?
9. Indent your code properly.
10. Ultimately redundant plugin, bad idea and awful code.

Cya..
you right i will update it in new realise version with powers menu
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-24-2017 , 03:37   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #13

Code:
register_clcmd("amx_give_prestige", "admin_prestige", ADMIN_LEVEL_A, "<name> <amount>")
Code:
public admin_prestige (id, level, cid) {     if(!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED;     new arg[32], arg2[32];     read_argv(1, arg, 32);     read_argv(2, arg2, 31);         new player = cmd_target(id,arg,2);     if(!player) return PLUGIN_HANDLED;         new prestigeamount = str_to_num(arg2);     set_user_prestige(player, get_user_prestige(player) + prestigeamount);         if( prestigeamount < 0 )     {         console_print(id, "You can't give player prestige lower that 0");         return PLUGIN_HANDLED;     }         new player_name[32], admin_name[32];     get_user_name(player, player_name, 31);     get_user_name(id, admin_name, 31);         switch(get_cvar_num("amx_show_activity"))     {         case 2: client_print(0, print_chat, "ADMIN %s: give %s %i Prestige", admin_name, player_name, prestigeamount);         case 1: client_print(0, print_chat, "ADMIN: give %s %i Prestige", player_name, prestigeamount);     }         return PLUGIN_HANDLED; }
For lazy admins...
__________________

Last edited by Relaxing; 02-24-2017 at 15:09.
Relaxing is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 02-24-2017 , 08:26   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #14

nice idea !
gona add it in new version!!
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
draklia
Junior Member
Join Date: Jan 2016
Old 02-24-2017 , 09:15   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #15

Quote:
Originally Posted by edon1337 View Post
1. dproto installed.
2. Using Fakemeta Util is wrong.
3. Use style 0 of natives.
4. You can create
PHP Code:
new PrestigeCost 
before switch so you don't need to create it many times.
5.
PHP Code:
for(id 1id <= get_maxplayers(); id++) { 
Cache get_maxplayers on plugin_init.
6.
PHP Code:
if(is_user_alive(id) && is_user_connected(id)) 
No need to check is_user_connected.
7. Use nVault for saving.
8. Why are you using a HudMessage stock?
9. Indent your code properly.
10. Ultimately redundant plugin, bad idea and awful code.

Cya..
Nvault deletes data, maps are slowing down, so did quite well, although I would solve it through Fvault.
__________________
You want to say?
draklia is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-24-2017 , 09:41   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #16

Quote:
Originally Posted by draklia View Post
Nvault deletes data, maps are slowing down, so did quite well, although I would solve it through Fvault.
LOL you'd lose data with FVault too.
__________________
edon1337 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-24-2017 , 13:05   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #17

Updated the code -
Blocked to give player prestige lower than 0.
Added the chat print command.
__________________
Relaxing is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-24-2017 , 14:51   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #18

Quote:
Originally Posted by Relaxing View Post
Blocked to give player prestige lower than 0.
Why? With negative values you can decrease player's prestiges.
__________________

Last edited by edon1337; 02-24-2017 at 15:57.
edon1337 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-24-2017 , 15:11   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #19

Quote:
Originally Posted by edon1337 View Post
Why? With negative values you can decrease player prestige's.
Code:
register_clcmd("amx_take_prestige", "admin_takeprestige", ADMIN_LEVEL_A, "<name> <amount>")
Code:
public admin_takeprestige (id, level, cid) {     if(!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED;     new arg[32], arg2[32];     read_argv(1, arg, 32);     read_argv(2, arg2, 31);         new player = cmd_target(id,arg,2);     if(!player) return PLUGIN_HANDLED;         new prestigeamount = str_to_num(arg2);     set_user_prestige(player, get_user_prestige(player) - prestigeamount);         if( prestigeamount >  get_user_prestige(player))     {         console_print(id, "You can't set player prestige lower that 0");         return PLUGIN_HANDLED;     }         new player_name[32], admin_name[32];     get_user_name(player, player_name, 31);     get_user_name(id, admin_name, 31);         switch(get_cvar_num("amx_show_activity"))     {         case 2: client_print(0, print_chat, "ADMIN %s: took %i Prestige from %s", admin_name, prestigeamount, player_name);         case 1: client_print(0, print_chat, "ADMIN: took %i Prestige from %s", prestigeamount, player_name,);     }         return PLUGIN_HANDLED; }
__________________

Last edited by Relaxing; 02-24-2017 at 15:12.
Relaxing is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 02-25-2017 , 06:37   Re: [GunXP] Prestige Shop 1.0
Reply With Quote #20

Quote:
Originally Posted by edon1337 View Post
Why? With negative values you can decrease player's prestiges.
no need for decrease need get be rested with set prestige command
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
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:58.


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