Quote:
Originally Posted by guipatinador
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
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(szOutput, charsmax(szOutput), szMessage, szName, HEALTH, ARMOR, floatround(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.