HELP!?!? dialog doesnt open! -
BigAl - 23.11.2010
My dialog doesnt open when i type /vbuy anyone know why.
Here the code
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/buy", true) == 0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Commands!","1. CAR! (calls an airstrike in\r\n2. /[un]lock, Locks the vehicle your in!\r\n3. /help\r\n4. /info\r\n5. /news,","Continue", "Cancel");
return 1;
}
return 0;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1:
{
if(!response)
{
SendClientMessage(playerid, COLOR_RED, "You cancelled!");
}
switch(listitem)
{
case 0:
{
new Float:X, Float:Y, Float:Z, Float:ROT;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle (playerid,ROT);
SpawnedVehicles[playerid] = CreateVehicle(400,X,Y,Z,ROT,-1,-1,60);
}
}
}
}
return 1;
}
Re: HELP!?!? dialog doesnt open! - [L3th4l] - 23.11.2010
Change the dialog id, which in your case is '1', change to something like '999'
Re: HELP!?!? dialog doesnt open! -
Mauzen - 23.11.2010
Does your server say 'Unknown command', or is the dialog just not showing up?
Re: HELP!?!? dialog doesnt open! -
BigAl - 23.11.2010
Doesnt say that, just doesnt show, like even when i type /cmds which i aint got at all, it doesnt say Unknown Command!
Re: HELP!?!? dialog doesnt open! -
Alex_Valde - 23.11.2010
You could try this...
Under your public OnDialogResponse, don't do "switch(dialogid)"
do if(dialogid == 1) and then the rest.
So it will be like:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(!response)
{
SendClientMessage(playerid, COLOR_RED, "You cancelled!");
}
switch(listitem)
{
case 0:
{
new Float:X, Float:Y, Float:Z, Float:ROT;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle (playerid,ROT);
SpawnedVehicles[playerid] = CreateVehicle(400,X,Y,Z,ROT,-1,-1,60);
}
}
}
return 1;
}
If this doesn't work try to print something when your command is called.
Re: HELP!?!? dialog doesnt open! -
DRIFT_HUNTER - 23.11.2010
[EDIT]Ah already answered
Re: HELP!?!? dialog doesnt open! -
BigAl - 23.11.2010
Okay, thanks, gunna go test it now