SA-MP Forums Archive
3 strings in a dialog = Warning - 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: 3 strings in a dialog = Warning (/showthread.php?tid=492654)



3 strings in a dialog = Warning - davve95 - 04.02.2014

Hi!


I recently scripted a bit with strings in a dialog..

But I get some warnings:

Код:
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(2517) : warning 202: number of arguments does not match definition
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(2517) : warning 202: number of arguments does not match definition
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(2517) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Here's the code:

pawn Код:
format(stringScore, sizeof(stringScore), "Your score is: %i",GetPlayerScore(playerid));
format(stringMoney, sizeof(stringMoney), "Money: %i",GetPlayerMoney(playerid));
format(stringWanted, sizeof(stringWanted), "Wanted level: %i", GetPlayerWantedLevel(playerid));
               
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Stats","test",stringScore,stringMoney,stringWanted, "Ok", "");
Doesn't it work to have 3 strings in a dialog or?...


Re: 3 strings in a dialog = Warning - KaliKs - 04.02.2014

Warnings dosent usually do anything to your script if you dont have like 100 of them but it will work


Re: 3 strings in a dialog = Warning - BullseyeHawk - 04.02.2014

pawn Код:
new usageString[128];
format(usageString, sizeof(usageString), "Your score is: %i\nMoney: %i\nWanted level: %i", GetPlayerScore(playerid), GetPlayerMoney(playerid), GetPlayerWantedLevel(playerid));
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Stats", usageString, "OK", "");
The problem is, you can't add params that are not defined inside the native.
You can't use ShowPlayerDialog as a in-built format.
You need to format it first, the whole string. And then print it out towards the ShowPlayerDialog.

ShowPlayerDialog native
format native


Re: 3 strings in a dialog = Warning - davve95 - 04.02.2014

Thanks a lot guys I will try if it will work, recently started to work with stings didn't learn it when I were a beginner.

KaliKs @ Yeah I know but I thought it were better to fix it to fully.
But thanks! .