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

[Request] Plugin who gives some bonuses


Post New Thread Reply   
 
Thread Tools Display Modes
TedMan
Senior Member
Join Date: Oct 2012
Old 10-21-2012 , 08:57   Re: [Request] Plugin who gives some bonuses
Reply With Quote #11

No... pure and simple the message is not displayed
TedMan is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 10-21-2012 , 15:16   Re: [Request] Plugin who gives some bonuses
Reply With Quote #12

I don't have a lot of knowledge about messages, but, I think this,

PHP Code:
static saytext 0
    
if(!saytext)    get_user_msgid("SayText"
Should be,

PHP Code:
new saytext get_user_msgid("SayText"
Someone correct me if I'm wrong.
guipatinador is offline
TedMan
Senior Member
Join Date: Oct 2012
Old 10-21-2012 , 23:21   Re: [Request] Plugin who gives some bonuses
Reply With Quote #13

Now the message appears but appears like this :
[img]http://**************/a/img89/4548/10733530q.png[/img]
TedMan is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 10-22-2012 , 20:43   Re: [Request] Plugin who gives some bonuses
Reply With Quote #14

Quote:
Originally Posted by guipatinador View Post
I don't have a lot of knowledge about messages, but, I think this,

PHP Code:
static saytext 0
    
if(!saytext)    get_user_msgid("SayText"
Should be,

PHP Code:
new saytext get_user_msgid("SayText"
Someone correct me if I'm wrong.
There is a typo. Here is the correction....
PHP Code:
static saytext 0
if(!saytext)    saytext get_user_msgid("SayText"
What this is doing is initializing a static variable to 0. This allows the value of saytext to be persistent when being called. I set it to 0 so i can check to see if this is the first call of that statement, and if it is i THEN give it a value. The value then remains without needing to be set again. Because it will not be 0 from then on. This is done essentially so i can have a global variable, that is only set if it needs to be, and only used where it needs to be. Otherwise it is ignored. This method is more efficient than new saytext = get_user_msgid("SayText") in all cases when called more than once. (you're only calling the native get_user_msgid once per map)
Hope that makes sense....


Quote:
Originally Posted by TedMan View Post
Now the message appears but appears like this :
[img]http://**************/a/img89/4548/10733530q.png[/img]
This is because the last few numbers are required to be floats. If you don't want floats change this on line 100
Code:
new szOutput[192]; formatex(szOutput, charsmax(szOutput), szMessage, szName, HEALTH, ARMOR, SPEED, GRAVITY)
to this
PHP Code:
new szOutput[192]; formatex(szOutputcharsmax(szOutput), szMessageszNameHEALTHARMORfloatround(SPEED), floatround(GRAVITY) ) 
and this on line 46
Code:
new const szMessage[] = "^4[AMX] Player %s has recieved all bonus powers! %dHP %dAP %fSpeed %fGravity!"
to this
PHP Code:
new const szMessage[] = "^4[AMX] Player %s has recieved all bonus powers! %dHP %dAP %dSpeed %dGravity!" 

Attached is my original code all above corrections.
Attached Files
File Type: sma Get Plugin or Get Source (liver_ctBonus.sma - 326 views - 3.0 KB)
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
TedMan
Senior Member
Join Date: Oct 2012
Old 10-23-2012 , 10:20   Re: [Request] Plugin who gives some bonuses
Reply With Quote #15

Woks,thanks you
TedMan is offline
UKalex
New Member
Join Date: Oct 2012
Old 10-28-2012 , 02:57   Re: [Request] Plugin who gives some bonuses
Reply With Quote #16

Hello, can somebody modify the plugin like this?
[AMX] Player %s has recieved all bonus powers! show to all players. Then, the rest of the message to show only the chosen player to get all bonuses.
And please, can add a red hud message to show when de player who get all bonuses dies ? Somethis like this : "Player X died^Rest in peace"
Thank you
UKalex 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 04:58.


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