big problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: big problem (
/showthread.php?tid=193488)
big problem -
jonnyboy - 26.11.2010
heya, i got a big problem.
im trying to make my animations command and i nothing happens
i looked on a tutorial and on some help here and it did everything like it said. but when i press on animations 1 (dialog) then nothing happens
here is the code:
pawn Код:
// Animlist
#define DialogID 123
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/animlist", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,DialogID, DIALOG_STYLE_LIST, "Animations", "Animation1 \nAnimation2 \nAnimation3\nAnimation4", "Cancel", "Continue");
SendClientMessage(playerid, 0xFFFF00AA, "Animation Commands!");
return 1;
}
return 0;
}
Re: big problem -
Gavin - 26.11.2010
You need to do a OnDialogResponce Code
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// the code here
return 1;
}
If you do not have that code, the buttons will do nothing, it'll just close the dialog.
I belive this tutorial will help you:
https://sampwiki.blast.hk/wiki/How_to_Cr...og#List_dialog
or if you're too lazy this should work:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response) //they pressed the first button
{
switch(dialogid)
{
case 1:
{
switch(listitem) //wich listitem is chosen
{
case 0://the first item in the list
{
// do animation code here
}
case 1:
{
// do animation code here
}
case 2:
{
// do animation code here
}
case 3:
// do animation code here
{
}
}
}
}
return 1;
}
Indenting got fucked up.. sorry.