[BUG] GameTextForPlayer
#1

I've found a bug on 0.3z's GameTextForPlayer function that it doesn't show up the value '1' within some color formats. If you want to test it for yourself, try this code:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/gtext")) return GameTextForPlayer(playerid, "~G~OBJECT DAMAGED!~N~~Y~OBJECT ID ~W~: ~R~1~N~~Y~HP LEFT ~W~: ~R~100", 1800, 3);
    return 0;
}
It won't be showing like "OBJECT ID : 1". Instead of that, it'll be displaying "OBJECT ID : ". It works fine if I'm doing it as "01" instead of "1".
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/gtext")) return GameTextForPlayer(playerid, "~G~OBJECT DAMAGED!~N~~Y~OBJECT ID ~W~: ~R~01~N~~Y~HP LEFT ~W~: ~R~100", 1800, 3);
    return 0;
}
I've tested if this bug was there on 0.3x and it don't seem to be. It's definitely the problem of 0.3z in my view. It can be fixed through coding but however it's much better if fixed on the further RC releases.
Reply
#2

Very old bug, and nothing to do with SA-MP. It's definitely nothing to do with 0.3z. It can be fixed by moving the space:

"~G~OBJECT DAMAGED!~N~~Y~OBJECT ID ~W~:~R~ 1~N~~Y~HP LEFT ~W~: ~R~100"

(not tested)
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Very old bug, and nothing to do with SA-MP. It's definitely nothing to do with 0.3z. It can be fixed by moving the space:

"~G~OBJECT DAMAGED!~N~~Y~OBJECT ID ~W~:~R~ 1~N~~Y~HP LEFT ~W~: ~R~100"

(not tested)
I didn't notice that it's an old bug. But it works fine when the function is executed in-game and also it works fine even without space. (On 3x, I don't know about 3z). Thanks for the tip in moving space though, that would cease some of my problems.
Reply
#4

0.3z includes the fixes from 0.3x R2. It could be possible that some earlier fix for this was (accidentally) removed again in 0.3x R2 /0.3z, if youre sure it worked in the previous version.
Reply
#5

http://*********/roOmF46J0Y0
Reply
#6

This is because ~1~ is a gametext format in itself, but it can't be used in SA-MP. It removes the '1' like it removes the 'r' in ~r~ as well. It's the SCM-equivalent of %i and %s etc.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)