Help Dialog and Commands
#1

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.

Reply
#2

Show lines 400 - 402.
Reply
#3

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

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
{

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)