Dialog Response
#1

Код:
D:\Trucking\gamemodes\Tuntun.pwn(299) : error 030: compound statement not closed at the end of file (started at line 291)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_TUNING)
	{
		if(response)
		{
			if(listitem == 1)
			{
				SetVehicleHealth(playerid,1000);
				return 1;
			}
}
Reply
#2

Well obviously dude, close your brackets!

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TUNING)
    {
        if(response)
        {
            if(listitem == 1)
            {
                SetVehicleHealth(playerid,1000);
            }
            return 1;
        }
    }
    return 0;
}
Plus, I suggest, when you have several dialogs, using a switch. I believe it's much faster. Example:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_TUNING:
        {
            if(response)
            {
                if(listitem == 1)
                {
                    SetVehicleHealth(playerid,1000);
                }
                return 1;
            }
        }
    }
    return 0;
}
Reply
#3

read the wiki
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_TUNING){ if(response)
		{ if(listitem == 1) { SetVehicleHealth(playerid,1000);}
		}
		return 1;
	}
	return 0;
}
I made the code alittle more efficient to save some space i suggest you read the wiki because you where putting return 1; in wrong spot

kindred where is your return 0;?
if your gonna do that, that means he has more ondialogresponse script in there meaning the first(at top) dialogid he opened he never closed it, non of your dialogs will work this way.
Reply
#4

Quote:
Originally Posted by Kindred
Посмотреть сообщение
Well obviously dude, close your brackets!

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TUNING)
    {
        if(response)
        {
            if(listitem == 1)
            {
                SetVehicleHealth(playerid,1000);
                return 1;
            }
        }
    }
    return 0;
}
Plus, I suggest, when you have several dialogs, using a switch. I believe it's much faster. Example:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_TUNING:
        {
            if(response)
            {
                if(listitem == 1)
                {
                    SetVehicleHealth(playerid,1000);
                    return 1;
                }
            }
        }
    }
    return 0;
}
pawn Код:
D:\Trucking\gamemodes\Tuntun.pwn(300) : warning 209: function "OnDialogResponse" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Reply
#5

use mine kindred did it wrong or something(no offense)
Reply
#6

Actually, I didn't, he probably just used the one I posted before I edited it (I posted too early).
Reply
#7

oh i see, he edited his post lolol...
Reply
#8

Possible to make a checkpoint at this location:
-2034.9296,178.9917,28.8429

and if we enter the location we use that /tuning cmd and the dialog will open?
Reply
#9

SetPlayerCheckPoint ←←←←← CLICK
learn to use the wiki before asking for help as i stated above.
Reply
#10

Yea dude, you really need to learn to use ****** and learn to script

But since I'm not entirely an asshole, here, this is an example:

pawn Код:
// Somewhere not in a function.  Global Variable
new ActiveCheckpoint[MAX_PLAYERS];

//Wherever you want to set the checkpoint
ActiveCheckpoint[playerid] = 1;
SetPlayerCheckpoint(playerid, -2034.9296, 178.9917, 28.8429, 3.0);

//The OnPlayerEnterCheckpoint Function

public OnPlayerEnterCheckpoint(playerid)
{
    if(ActiveCheckpoint[playerid] == 1)
    {
        //if they enter the checkpoint you set
        ShowPlayerDialog(blablabla); //Your dialog here to open
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)