Dialog Response -
Tuntun - 20.06.2013
Код:
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;
}
}
Re: Dialog Response -
Kindred - 20.06.2013
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;
}
Re: Dialog Response -
SwisherSweet - 20.06.2013
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.
Re: Dialog Response -
Tuntun - 20.06.2013
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.
Re: Dialog Response -
SwisherSweet - 20.06.2013
use mine kindred did it wrong or something(no offense)
Re: Dialog Response -
Kindred - 20.06.2013
Actually, I didn't, he probably just used the one I posted before I edited it (I posted too early).
Re: Dialog Response -
SwisherSweet - 20.06.2013
oh i see, he edited his post lolol...
Re: Dialog Response -
Tuntun - 20.06.2013
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?
Re: Dialog Response -
SwisherSweet - 20.06.2013
SetPlayerCheckPoint ←←←←← CLICK
learn to use the wiki before asking for help as i stated above.
Re: Dialog Response -
Kindred - 20.06.2013
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;
}