SA-MP Forums Archive
[BUG] GameTextForPlayer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [BUG] GameTextForPlayer (/showthread.php?tid=488322)



[BUG] GameTextForPlayer - Lordzy - 17.01.2014

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.


Re: [BUG] GameTextForPlayer - MP2 - 17.01.2014

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)


Re: [BUG] GameTextForPlayer - Lordzy - 17.01.2014

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.


Re: [BUG] GameTextForPlayer - Mauzen - 18.01.2014

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.


Re: [BUG] GameTextForPlayer - Meta - 18.01.2014

http://*********/roOmF46J0Y0


Re: [BUG] GameTextForPlayer - Basssiiie - 18.01.2014

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.