SA-MP Forums Archive
Help me with this! - 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: Help me with this! (/showthread.php?tid=656322)



Help me with this! - GameOvr - 13.07.2018

i'm getting this error while compiling how to fix:
Код:
#include <a_samp>
#include <zcmd>

#define DIALOG_BUY_WEAPONS 311

CMD:buyweapons (playerid, params[])
{
 ShowPlayerDialog(playerid, DIALOG_BUY_WEAPONS, DIALOG_STYLE_LIST, "                    ...:::Weapon-Shop:::...                 ", "{8080FF}Armour                               -   2000$\n{8080FF}Deagle                              -   1000$\n{8080FF}Shotgun                               -   2000$\n{8080FF}AK-47                              -   2000$\n{8080FF}9mm                               -   2000$\n{8080FF}M4                               -   2000$\n{8080FF}Spass12                              -   2000$\n{8080FF}Sawn-Off                               -   2000$\n{8080FF}Grenade                              -   2000$\n{8080FF}Uzi                               -   2000$\n{8080FF}MP5                              -   2000$\n", "Buy", "Cancel");
 return 1;
}
how to fix this

Код:
C:\Users\User\Documents\SA-MP script files\samp windows server\samp037_svr_R2-1-1_win32\filterscripts\Untitled3.pwn(7) : error 075: input line too long (after substitutions)
C:\Users\User\Documents\SA-MP script files\samp windows server\samp037_svr_R2-1-1_win32\filterscripts\Untitled3.pwn(8) : error 037: invalid string (possibly non-terminated string)
C:\Users\User\Documents\SA-MP script files\samp windows server\samp037_svr_R2-1-1_win32\filterscripts\Untitled3.pwn(8) : error 029: invalid expression, assumed zero
C:\Users\User\Documents\SA-MP script files\samp windows server\samp037_svr_R2-1-1_win32\filterscripts\Untitled3.pwn(8) : error 029: invalid expression, assumed zero
C:\Users\User\Documents\SA-MP script files\samp windows server\samp037_svr_R2-1-1_win32\filterscripts\Untitled3.pwn(8) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Re: Help me with this! - TadePoleMG - 13.07.2018

Use strcat.


Re: Help me with this! - GameOvr - 13.07.2018

plz tell me how idk what is that. gimme even a link of a tutorial


Re: Help me with this! - coool - 13.07.2018

I would suggest using the new DIALOG_STYLE_TABLIST, https://sampwiki.blast.hk/wiki/Dialog_Styles


Re: Help me with this! - GameOvr - 13.07.2018

plz somebody help


Re: Help me with this! - GameOvr - 13.07.2018

Quote:
Originally Posted by coool
Посмотреть сообщение
I would suggest using the new DIALOG_STYLE_TABLIST, https://sampwiki.blast.hk/wiki/Dialog_Styles
i mean help me with an example i tried wiki how but i cant understand


Re: Help me with this! - TadePoleMG - 13.07.2018

Use a string for format and a destination string. Like
PHP код:
new string[128], desstring[500];
// Then Using format
format(stringsizeof(string),"...:::Weapon-Shop:::... \n\n");
// Using strcat
strcat(desstringstring);
format(stringsizeof(string),"{8080FF}Armour\t-\t2000$\n");
strcat(desstringstring);
// And so on......
// Then use ShowPlayerDialog like this
ShowPlayerDialog(playeridDIALOG_IDDIALOG_STYLE_LIST,"Weapons Shop"desstring,"Buy""Close"); 
That's it.
Thank You.


Re: Help me with this! - Florin48 - 13.07.2018

Quote:
Originally Posted by TadePoleMG
Посмотреть сообщение
Use a string for format and a destination string. Like
PHP код:
new string[128], desstring[500];
// Then Using format
format(stringsizeof(string),"...:::Weapon-Shop:::... \n\n");
// Using strcat
strcat(desstringstring);
format(stringsizeof(string),"{8080FF}Armour\t-\t2000$\n");
strcat(desstringstring);
// And so on......
// Then use ShowPlayerDialog like this
ShowPlayerDialog(playeridDIALOG_IDDIALOG_STYLE_LIST,"Weapons Shop"desstring,"Buy""Close"); 
That's it.
Thank You.
he can use it directly:

strcat(desstring, "...:::Weapon-Shop:::... \n\n");
strcat(desstring, "{8080FF}Armour\t-\t2000$\n");

it is not necessary format(string....