Dialog help
#1

Hello i maked a Dialog but i wanna add more commands with dialog
when i trying add new dialogs it's giving me around 6 errors
can you explain how add two Dialog's in same GM thanks
Reply
#2

What are the errors and post your gamemode using [{pawn] your code [/pawn]
(remove { this after [).
Reply
#3

You should define like


#define dialog1 0


And later on you can check with if(dialogid == dialog1)

And when adding dialog remember to change to defined id
Reply
#4

Код:
C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Gangwar.pwn(773) : warning 225: unreachable code
C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Gangwar.pwn(863) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Gangwar.pwn(863) : error 004: function "OnPlayerClickPlayer" is not implemented
C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Gangwar.pwn(866) : error 017: undefined symbol "clickedplayerid"
C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Gangwar.pwn(870) : error 030: compound statement not closed at the end of file (started at line 767)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 2 && response)
    {
    if(response)
		{
		GivePlayerWeapon(playerid,WEAPON_COLT45,100);
		GivePlayerMoney(playerid,-1000);
		if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
	return 1;
    if(dialogid == 1 && response)
	{
    if(response)
		{
		GivePlayerWeapon(playerid,WEAPON_COLT45,100);
		GivePlayerMoney(playerid,-1000);
		if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
		}
	if(listitem == 1)
		{
		GivePlayerWeapon(playerid,WEAPON_SILENCED,100);
		GivePlayerMoney(playerid,-1200);
		if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 2)
		{
		GivePlayerWeapon(playerid,WEAPON_DEAGLE,75);
        GivePlayerMoney(playerid,-1500);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 3)
		{
		GivePlayerWeapon(playerid,25,50);
        GivePlayerMoney(playerid,-2000);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 4)
		{
		GivePlayerWeapon(playerid,WEAPON_SAWEDOFF,50);
        GivePlayerMoney(playerid,-2500);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 5)
		{
		GivePlayerWeapon(playerid,WEAPON_SHOTGSPA,25);
        GivePlayerMoney(playerid,-2500);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 6)
		{
		GivePlayerWeapon(playerid,WEAPON_UZI,150);
        GivePlayerMoney(playerid,-2000);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 7)
		{
		GivePlayerWeapon(playerid,WEAPON_MP5,200);
        GivePlayerMoney(playerid,-4000);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 8)
		{
		GivePlayerWeapon(playerid,WEAPON_AK47,200);
        GivePlayerMoney(playerid,-5000);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 9)
		{
		GivePlayerWeapon(playerid,WEAPON_M4,200);
		GivePlayerMoney(playerid,-5000);
		if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 10)
		{
		GivePlayerWeapon(playerid,WEAPON_TEC9,150);
        GivePlayerMoney(playerid,-2500);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
    if(listitem == 11)
		{
		GivePlayerWeapon(playerid,WEAPON_RIFLE,25);
        GivePlayerMoney(playerid,-3000);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
	if(listitem == 12)
		{
		GivePlayerWeapon(playerid,WEAPON_SNIPER,20);
        GivePlayerMoney(playerid,-4000);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
	if(listitem == 13)
		{
		SetPlayerHealth(playerid, 100.0 );
        GivePlayerMoney(playerid,-4000);
        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
  		}
}
    return 1;
}
	
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new message[32];
	format(message, sizeof(message), "You clicked on player %d", clickedplayerid);
	SendClientMessage(playerid, 0xFFFFFFFF, message);
    return 1;
}
Код:
#define dialog2 0
Reply
#5

Remove the return 1; at the top.
Reply
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
Remove the return 1; at the top.
i'll try thanks
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)