SA-MP Forums Archive
Help Dialog and Commands - 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 Dialog and Commands (/showthread.php?tid=628195)



Help me , please - huansohn - 07.02.2017

code : define
Quote:

#define LAYBANGDAN1 (5081)

Code : Commands
Quote:

CMD:laybangdantest(playerid, params[])
{
return ShowPlayerDialog(playerid, LAYBANGDAN1, DIALOG_STYLE_LIST, "CHE TAO BANG DAN","M4", "Chon", "Huy Bo");
}

Code: Dialog
Quote:

if(dialogid == LAYBANGDAN1)
{
if(response)
{
switch(listitem)
{
case 0: // M4 Test
{
new weapon, ammosd;
GetPlayerWeaponData(playerid, 2, weapon, ammosd);
if(weapon == 31)
}
if(PlayerInfo[playerid][pMats] > 100)
{
PlayerInfo[playerid][pMats] -= 100;
GivePlayerAmmoEx(playerid, weapon, 50);
SetPlayerArmedWeapon(playerid, weapon);
SendClientMessageEx(playerid, COLOR_YELLOW, "Ban da che tao 1 bang dan cho khau sung M4 cua ban.");
}
else
{
SendClientMessageEx(playerid, COLOR_YELLOW, "Ban khong du vat lieu.");
}
else
{
SendClientMessageEx(playerid, COLOR_YELLOW, "Ban khong co vu khi , nen khong the che tao dan");
}
}

When F5
Quote:

./includes/OnDialogResponse.pwn(400) : error 002: only a single statement (or expression) can follow each "case"
./includes/OnDialogResponse.pwn(400) : error 017: undefined symbol "LAYBANGDAN1"
./includes/OnDialogResponse.pwn(400 -- 402) : error 001: expected token: "}", but found "if"
./includes/OnDialogResponse.pwn(400 -- 402) : fatal error 107: too many error messages on one line

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


4 Errors.




Re: Help Dialog and Commands - Dayrion - 07.02.2017

Show lines 400 - 402.


Re: Help Dialog and Commands - LondonRP - 07.02.2017

what you want to do?
You want command to give player m4 or what?


Re: Help Dialog and Commands - huansohn - 08.02.2017

Give the player a gun and bullets, but I do it fails

400 - 402
Quote:

if(dialogid == LAYBANGDAN1)
{
if(response)
{
switch(listitem)
{
case 0: // M4 Test
{