Dialog help - 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: Dialog help (
/showthread.php?tid=604173)
Dialog help -
sheNdjze - 01.04.2016
Well im getting mad at this and i dont know what to do anymore, help me guys, please...
D:\Ionut\Other\gta\Scripting\PENLS\gamemodes\penls .pwn(9082) : error 048: array dimensions do not match
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Line 9082: ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, "{076F13}Stats", ShowStats(playerid), "Ok", "");
i've try to put array new Stats[256]; or larger sizeof but it shows only last format with "completed stuff"...
ShowStats(playerid)
{
new Stats[2][256];
format(Stats[0], 256, "{F0FF00}General Informations\n{FF0000}PlayerLevel: {FFFFFF}[%d]\n{FF0000}SpawnHealth: {FFFFFF}[%.1f]\n{FF0000}Cash: {FFFFFF}[$%d]\n{FF0000}Bank: {FFFFFF}[$%d]\n{FF0000}Phone Number: {FFFFFF}[%d]\n\n", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pSHealth]+50, GetPlayerMoney(playerid), PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pPnumber]);
format(Stats[1], 256, "{F0FF00}Completed Stuff\n{FF0000}CashBox: {FFFFFF}[%d/4]\n{FF0000}HotWire: {FFFFFF}[%d/4]\n{FF0000}StreetRace: {FFFFFF}[%d/4]\n{FF0000}Service: {FFFFFF}[%d/20]\n\n", PlayerInfo[playerid][pCB], PlayerInfo[playerid][pHW], PlayerInfo[playerid][pSR], PlayerInfo[playerid][pWA]);
return Stats;
}
Re: Dialog help -
Konstantinos - 01.04.2016
Do not use 2D array.
pawn Код:
ShowStats(playerid)
{
new Stats[400]; // increase if needed
format(Stats, sizeof Stats, "{F0FF00}General Informations\n{FF0000}PlayerLevel: {FFFFFF}[%d]\n{FF0000}SpawnHealth: {FFFFFF}[%.1f]\n{FF0000}Cash: {FFFFFF}[$%d]\n{FF0000}Bank: {FFFFFF}[$%d]\n{FF0000}Phone Number: {FFFFFF}[%d]\n\n", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pSHealth] + 50, GetPlayerMoney(playerid), PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pPnumber]);
format(Stats, sizeof Stats, "%s{F0FF00}Completed Stuff\n{FF0000}CashBox: {FFFFFF}[%d/4]\n{FF0000}HotWire: {FFFFFF}[%d/4]\n{FF0000}StreetRace: {FFFFFF}[%d/4]\n{FF0000}Service: {FFFFFF}[%d/20]\n\n", Stats, PlayerInfo[playerid][pCB], PlayerInfo[playerid][pHW], PlayerInfo[playerid][pSR], PlayerInfo[playerid][pWA]);
return Stats;
}
Re: Dialog help -
sheNdjze - 01.04.2016
awesome dude, thank you +rep, you saved me thank you once again