SA-MP Forums Archive
String error - 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: String error (/showthread.php?tid=255232)



String error - marrcko - 14.05.2011

Hi, i don't get it why this happens:
http://i53.tinypic.com/2woj7o7.png
In English:
"telefono numeris" = phone number
"Gaujos ID" = gang id
"Gaujos pavadinimas" = gang name
pawn Код:
new msg[300];
                new telnr,xp, gid;
                xp = GetPlayerScore(playerid);
                telnr = player[playerid][number];
                gid = gplayerDB[playerid][gangid];
                format(msg, 300, "Telefono numeris: %i\nExp: %i\nGaujos Id: %i\nGaujos pavadinimas: %d",telnr,xp, gid,gangDB[gid][gvardas]);
                ShowPlayerDialog(playerid,12,DIALOG_STYLE_MSGBOX,"Informacija apie tave",msg,"Ok","Atgal");
Anyone can help me?


Re: String error - LetsOWN[PL] - 14.05.2011

Analyzing the code and SS, everything's okay.. What's wrong with it?


Re: String error - marko94 - 14.05.2011

What exactly happens?


Re: String error - marrcko - 14.05.2011

last line in msgbox should show gang name after " : " but as u see its number
P.S. I know what name is existing..I check it with another cmd


Re: String error - LetsOWN[PL] - 14.05.2011

Ah, it's littile mistake

Replace
Код:
format(msg, 300, "Telefono numeris: %i\nExp: %i\nGaujos Id: %i\nGaujos pavadinimas: %d",telnr,xp, gid,gangDB[gid][gvardas]);
instead of
Код:
format(msg, 300, "Telefono numeris: %i\nExp: %i\nGaujos Id: %i\nGaujos pavadinimas: %s",telnr,xp, gid,gangDB[gid][gvardas]);
The mistake was here: Gaujos pavadinimas: %d
%d is for numerical things (eg ID)
%s is for strings (name, localization, city, etc)


Re: String error - marrcko - 14.05.2011

thx man, it works