SA-MP Forums Archive
How to fix a textdraw bug - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to fix a textdraw bug (/showthread.php?tid=65476)



How to fix a textdraw bug - LibertyWorld - 13.02.2009

Thanks i fixed the warnings, but now i have a problem that i have 2 textdraw that are confused, the textdraw i have as a filterscript appears at the place of this textdraw and it starts to flash...

What can i do?



Re: How many Objects does a GM support? - harrold - 13.02.2009

150
xstreamer plugin: 4.000.000


Re: How many Objects does a GM support? - LibertyWorld - 13.02.2009

Quote:
Originally Posted by harrold
150
Thanks


Re: How many Objects does a GM support? - Think - 13.02.2009

Quote:
Originally Posted by plɹoʍ ʎʇɹǝqıl
Quote:
Originally Posted by harrold
150
Thanks
https://sampwiki.blast.hk/wiki/Limits

ohai


Re: How to fix these Warnings??? - LibertyWorld - 13.02.2009

How to fix these Warnings?

pawn Код:
warning 219: local variable "x" shadows a variable at a preceding level
warning 219: local variable "y" shadows a variable at a preceding level
warning 219: local variable "z" shadows a variable at a preceding level
warning 219: local variable "string" shadows a variable at a preceding level
Here are the lines that give errors
pawn Код:
new Float:x,Float:y,Float:z;
new Float:distance,value,string[256];
Here is how its included in the script

pawn Код:
public UpdateSpeed()
{
    new Float:x,Float:y,Float:z;
    new Float:distance,value,string[256];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            TextDrawDestroy(Speedo[i]);
        }
    }
Thanks


Re: How to fix these Warnings??? - harrold - 13.02.2009

Quote:
Originally Posted by plɹoʍ ʎʇɹǝqıl
How to fix these Warnings?

pawn Код:
warning 219: local variable "x" shadows a variable at a preceding level
warning 219: local variable "y" shadows a variable at a preceding level
warning 219: local variable "z" shadows a variable at a preceding level
warning 219: local variable "string" shadows a variable at a preceding level
Here are the lines that give errors
pawn Код:
new Float:x,Float:y,Float:z;
new Float:distance,value,string[256];
Here is how its included in the script

pawn Код:
public UpdateSpeed()
{
    new Float:x,Float:y,Float:z;
    new Float:distance,value,string[256];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            TextDrawDestroy(Speedo[i]);
        }
    }
Thanks
You have new Float,Float:y,Float:z;
on the top of your script already
Delete that


Re: How to fix these Warnings??? - LibertyWorld - 13.02.2009

Thanks i fixed the warnings, but now i have a problem that i have 2 textdraw that are confused, the textdraw i have as a filterscript appears at the place of this textdraw and it starts to flash...

What can i do?


Re: How to fix these Warnings??? - Think - 13.02.2009

Quote:
Originally Posted by plɹoʍ ʎʇɹǝqıl
Thanks i fixed the warnings, but now i have a problem that i have 2 textdraw that are confused, the textdraw i have as a filterscript appears at the place of this textdraw and it starts to flash...

What can i do?
put both textdraws in the FS or GM


Re: How to fix a textdraw bug - harrold - 13.02.2009

You use a speedo?


Re: How to fix a textdraw bug - LibertyWorld - 13.02.2009

Quote:
Originally Posted by harrold
You use a speedo?
Yes, but the speedo is built in GM