Raised This Month: $66 Target: $400
 16% 

Buy Icon Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   HamletEagle (32)
bibu
Veteran Member
Join Date: Sep 2010
Old 07-06-2017 , 15:26   Buy Icon Fix
Reply With Quote #1

Buy Icon Fix

by "KayDee"


This plugin removes the buy icon from players screen, when there are not supposed to buy anything. (Example maps: awp_map, aim_crazyjump...)
Attached Files
File Type: sma Get Plugin or Get Source (buy_icon_fix.sma - 667 views - 823 Bytes)
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.

Last edited by bibu; 07-09-2017 at 15:07.
bibu is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 07-06-2017 , 20:26   Re: Buy Icon Fix
Reply With Quote #2

Nice Job!
realy nice!
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-08-2017 , 12:34   Re: Buy Icon Fix
Reply With Quote #3

For approval:
1.Use charsmax.
2.You could so something like new const FuncBuyZone[] = "func_buyzone" and then use that so you don't repeat the string.
__________________
HamletEagle is offline
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 07-08-2017 , 16:49   Re: Buy Icon Fix
Reply With Quote #4

public plugin_precache() register_plugin("Buy Icon Fix", "1.0", "KayDee")
precache or init ...?
__________________
Ayman Khaled is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-08-2017 , 17:34   Re: Buy Icon Fix
Reply With Quote #5

Quote:
Originally Posted by Ayman Khaled View Post
public plugin_precache() register_plugin("Buy Icon Fix", "1.0", "KayDee")
precache or init ...?
Can be done in precache too.
__________________
HamletEagle is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-09-2017 , 11:04   Re: Buy Icon Fix
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
For approval:
1.Use charsmax.
2.You could so something like new const FuncBuyZone[] = "func_buyzone" and then use that so you don't repeat the string.
I don't think, that these are reasons to decide wether to approve the plugin or not.
I'd like to know the benefits/optimization on this.
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.
bibu is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-09-2017 , 13:39   Re: Buy Icon Fix
Reply With Quote #7

You should not care only if your plugin works, but about the quality of your code. What I said does not add any benefit that the regular server owner will notice in-game, but are for consistency. We want all approved plugins to be examples of really well coded plugins, which use the best techniques. Too much crap already in that section.

Hardcoding string sizes is considered bad practice for obvious reasons.
If you use the same string multiple times, compiler will generate it multiple times in the output, because it sucks at optimizations. Using a constant solves the above problem and also you don't duplicate stuff, also IMHO code is cleaner like that.
__________________
HamletEagle is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-09-2017 , 15:07   Re: Buy Icon Fix
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
You should not care only if your plugin works, but about the quality of your code. What I said does not add any benefit that the regular server owner will notice in-game, but are for consistency. We want all approved plugins to be examples of really well coded plugins, which use the best techniques.
I don't think such statement would apply to any of my plugin.

Quote:
Originally Posted by HamletEagle View Post
If you use the same string multiple times, compiler will generate it multiple times in the output, because it sucks at optimizations.
I really doubt, that there is any difference in the output.

updated..
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.
bibu is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-10-2017 , 05:43   Re: Buy Icon Fix
Reply With Quote #9

Approved.

Quote:
I really doubt, that there is any difference in the output.
Let's check.

Code1:
Spoiler


Output1:
Spoiler


Code2:
Spoiler


Output2:
Spoiler


Look at DATA.
__________________

Last edited by HamletEagle; 07-10-2017 at 05:59.
HamletEagle is offline
SpawnerF
Member
Join Date: Apr 2017
Location: Morocco
Old 07-10-2017 , 11:30   Re: Buy Icon Fix
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
-snip-
How did you manage to get this output?

I mean adding argument -a gave me :

Code:
CODE	; 0
;program exit point
	halt 0
dump 74 65 73 74 0 

CODE	; 8
	proc	; plugin_init
	break	; c
	break	; 10
	push.c 0
	;$par
	push.c 4
	call my_func1
	;$exp
	break	; 2c
	push.c 0
	;$par
	push.c 4
	call my_func2
	;$exp
	zero.pri
	retn

	proc	; my_func1
	break	; 54
	;$lcl string c
	zero.pri
	retn

	proc	; my_func2
	break	; 64
	;$lcl string c
	zero.pri
	retn


STKSIZE 1000
I want it more clean
__________________
XX was created just for giving evidence and not meant to damage public servers.
&We do not test on public servers.
Thank's.
SpawnerF is offline
Reply


Thread Tools
Display Modes

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 23:20.


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