SA-MP Forums Archive
Textdraw problem.. - 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: Textdraw problem.. (/showthread.php?tid=216840)



Textdraw problem.. [Solved] - BuLLeT[LTU] - 26.01.2011

Hi. I Have problem with this code:

pawn Код:
stock TextDrawSetStringLang(playerid,txtdraw,const string1[], const string2[])
{
    switch(PlayerI[playerid][Lang])
    {
        case 0: // ENG
        {
            TextDrawSetString(txtdraw,string1); //16557 line
        }
        case 1: // LTU
        {
            TextDrawSetString(txtdraw,string2); //16561 line
        }
    }
}
Errors:
C:\Users\Mindaugas\Desktop\EU-PG\gamemodes\EU-PG.pwn(16557) : warning 213: tag mismatch
C:\Users\Mindaugas\Desktop\EU-PG\gamemodes\EU-PG.pwn(16557) : error 035: argument type mismatch (argument 2)
C:\Users\Mindaugas\Desktop\EU-PG\gamemodes\EU-PG.pwn(16561) : warning 213: tag mismatch
C:\Users\Mindaugas\Desktop\EU-PG\gamemodes\EU-PG.pwn(16561) : error 035: argument type mismatch (argument 2)
-----------------------------------------------
Solved:
pawn Код:
forward TextDrawSetStringLang(playerid, Text:txtdraw,string1[], string2[]);
public TextDrawSetStringLang(playerid, Text:txtdraw,string1[], string2[])
{
    switch(PlayerI[playerid][Lang])
    {
        case 0: // ENG
        {
            TextDrawSetString(txtdraw,string1);
        }
        case 1: // LTU
        {
            TextDrawSetString(txtdraw,string2);
        }
    }
}



Re: Textdraw problem.. - HyperZ - 26.01.2011

not getting any error.


Re: Textdraw problem.. - BuLLeT[LTU] - 26.01.2011

Somewhere put TextDrawSetStringLang(playerid,Textdaw,"a","a");

And then u will get this error..


Re: Textdraw problem.. - Vince - 26.01.2011

In your function header put: TextDrawSetStringLang(playerid, Text:txtdraw, const string1[], const string2[])


Re: Textdraw problem.. - BuLLeT[LTU] - 26.01.2011

C:\Users\Mindaugas\Desktop\EU-PG\gamemodes\EU-PG.pwn(16461) : error 035: argument type mismatch (argument 2)
C:\Users\Mindaugas\Desktop\EU-PG\gamemodes\EU-PG.pwn(16465) : error 035: argument type mismatch (argument 2)

Same errors...

I use this:

pawn Код:
new tblstr[512],tblstr3[512];
format(tblstr,sizeof(tblstr),"~y~%s statistika:~n~~w~Levelis: ~y~%d~w~ | Nuzudymai: ~y~%d~w~ | Mirtys: ~y~%d~w~ | Ratio: ~y~%.2f~w~ |~n~Patirties taskai: ~y~%d~w~/~r~%d~w~ |",PlayerName(i),PlayerI[i][Rank],PlayerI[i][Kills],PlayerI[i][Deaths],floatdiv(PlayerI[i][Kills],PlayerI[i][Deaths]),PlayerI[i][Exp],RankInfo[NewRank][RRequirement]);
format(tblstr3,sizeof(tblstr3),"~y~%s's stats:~n~~w~Level: ~y~%d~w~ | Kills: ~y~%d~w~ | Deaths: ~y~%d~w~ | Ratio: ~y~%.2f~w~ |~n~EXP Points: ~y~%d~w~/~r~%d~w~ |",PlayerName(i),PlayerI[i][Rank],PlayerI[i][Kills],PlayerI[i][Deaths],floatdiv(PlayerI[i][Kills],PlayerI[i][Deaths]),PlayerI[i][Exp],RankInfo[NewRank][RRequirement]);
TextDrawSetStringLang(i,StatsTable[i],tblstr3,tblstr);

stock TextDrawSetStringLang(playerid,Text:txtdraw,const string1[], const string2[])
{
    switch(PlayerI[playerid][Lang])
    {
        case 0: // ENG
        {
            TextDrawSetString(txtdraw,string1); //16461
        }
        case 1: // LTU
        {
            TextDrawSetString(txtdraw,string2);//16465
        }
    }
}