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

Win Messages Changer


Post New Thread Reply   
 
Thread Tools Display Modes
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 07-15-2013 , 16:16   Re: Win Messages Changer
Reply With Quote #11

Updated with some optimize (that in fact i dont understand why is now "optimized" because it worked fine as it was...)
__________________
Jhob94 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-15-2013 , 20:18   Re: Win Messages Changer
Reply With Quote #12

Changes in plugin:

Add:

PHP Code:
new g_iTextMsg
Add in plugin_init();

PHP Code:
g_iTextMsg get_user_msgid("TextMsg"
And replace in other lines

PHP Code:
get_user_msgid("TextMsg"); 
To

PHP Code:
g_iTextMsg 
And i think you not need to loop all players to sendo client_print or show_hudmessage,
Its simple to replace loop and User variable from loop to 0

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-16-2013 , 00:51   Re: Win Messages Changer
Reply With Quote #13

Not looked at plugin yet. But suggest adding cvar to change hud color for each message ? And maybe position?
__________________
Blizzard_87 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 07-16-2013 , 10:02   Re: Win Messages Changer
Reply With Quote #14

Quote:
Originally Posted by ^SmileY View Post
Changes in plugin:

Add:

PHP Code:
new g_iTextMsg
Add in plugin_init();

PHP Code:
g_iTextMsg get_user_msgid("TextMsg"
And replace in other lines

PHP Code:
get_user_msgid("TextMsg"); 
To

PHP Code:
g_iTextMsg 
For be more beauty?
I believe that who read the source code can understand better as it is at moment...
__________________
Jhob94 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-16-2013 , 10:07   Re: Win Messages Changer
Reply With Quote #15

Quote:
Originally Posted by Jhob94 View Post
For be more beauty?
I believe that who read the source code can understand better as it is at moment...
Optimization. The message id will never change, so why retrieve it more than once?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Old 07-16-2013, 10:08
bibu
This message has been deleted by bibu. Reason: :(
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 07-16-2013 , 10:27   Re: Win Messages Changer
Reply With Quote #16

Ok :'(
Btw i made it as you say, i also did some few more changes. It is working fine
__________________
Jhob94 is offline
Mauricio Frb
Member
Join Date: Jul 2013
Old 07-16-2013 , 10:55   Re: Win Messages Changer
Reply With Quote #17

Quote:
Originally Posted by ^SmileY View Post
WHAT? Do not create variables inside the loop, or you not understand?
Its a optmize thing and is required to be approve, its simple to create variable before loop?
Relax my friend, don't be aggressive.
Mauricio Frb is offline
Mauricio Frb
Member
Join Date: Jul 2013
Old 07-16-2013 , 10:59   Re: Win Messages Changer
Reply With Quote #18

Uh, use ShowSyncHudMsg otherelse show_hudmessage, because bugs.

Simple version:
Code:
new szSynchudmsg;

public plugin_init()
{
	szSynchudmsg = CreateHudSyncObj();
}

public my_function(id)
{
	set_hudmessage(150, 150, 150, -1.0, -1.0, 0, 2.0, 4.0);
	ShowSyncHudMsg(id, szSynchudmsg, "!!!!!TEst!!!!!");
}
Mauricio Frb is offline
BLacking98
Veteran Member
Join Date: Oct 2012
Location: California
Old 07-16-2013 , 11:30   Re: Win Messages Changer
Reply With Quote #19

Indeed it already exists, I've been trying to find it on the forum but I haven't found it. Good job tough
__________________
BLacking98 is offline
Mauricio Frb
Member
Join Date: Jul 2013
Old 07-16-2013 , 11:39   Re: Win Messages Changer
Reply With Quote #20

Look you only need to create a new function like Send_Message() when you use it 3 times ou more. Remove this public and put in Messages_Audio.

Last edited by Mauricio Frb; 07-16-2013 at 11:39.
Mauricio Frb 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 21:36.


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