SA-MP Forums Archive
I need help with my script - 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: I need help with my script (/showthread.php?tid=181031)



I need help with my script - steryman_007 - 03.10.2010

Hey guys I need help with this script:
Код:
#include <a_samp>

#define D_B 12111211 //dialog_base
#define info_color 0x4040FF
#define warning_color 0xFF0000

public OnFilterScriptInit()
{
print("\nSmoke and Drink Menu\nMade by Stery\nSuccessfully loaded!\n");
return 1;
}

public OnFilterScriptExit()
{
print("\nSmoke and Drink Menu\nMade by Stery\nSuccessfully unloaded!\n");
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/sadmenu", true) == 0 || strcmp(cmdtext, "/smokeanddrinksmenu", true) == 0) {
ShowPlayerDialog(playerid, D_B, DIALOG_STYLE_LIST, "Smoke And Drinks Menu", "Cigar\nSprunk\nBeer\nWine", "Select", "Cancel");
return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //the callback
{
  if (dialogid == D_B) //checking dialogid
  {
    if (response == 1) //select has been pressed
    {
      if(listitem == 0) //a switch, not going to explain it here
      {
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
			    SendClientMessage(playerid, info_color, "[INFO] Ti-ai ales tigara. Poti fuma apasand LMB (Left Mouse Button)");
			    SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din fumat apasa tasta F sau ENTER");
	  } else if(listitem == 1) {
        
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
                SendClientMessage(playerid, info_color, "[INFO] Ti-ai ales suc. Poti bea apasand LMB (Left Mouse Button)");
                SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din a bea suc apasa tasta F sau ENTER");
                } else if (listitem == 2) {
        
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                SendClientMessage(playerid, info_color, "[INFO] Ti-ai ales bere. Poti bea apasand LMB (Left Mouse Button)");
                SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din a bea bere apasa tasta F sau ENTER");
                SendClientMessage(playerid, warning_color, "[Atentie!] Daca consumi excesiv aceasta bautura te vei imbata!");
                SendClientMessage(playerid, warning_color, "[Atentie!] Caracterul tau nu va mai merge drept iar camera ti se va misca in toate partile!");
                } else if(listitem == 3) {
        
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
                SendClientMessage(playerid, info_color, "[INFO]Ti-ai ales vin. Poti bea apasand LMB(Left Mouse Button)");
                SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din a blea vin apasa tasta F sau ENTER");
                SendClientMessage(playerid, warning_color, "[Atentie!] Daca consumi excesiv aceasta bautura te vei imbata!");
                SendClientMessage(playerid, warning_color, "[Atentie!] Caracterul tau nu va mai merge drept iar camera ti se va misca in toate partile!");
        
      }
    }
    else //pressed cancel
    {
    }
    return 1; //returns 1, it has been handled
  }
  return 0;
}
Can you help me please? I made it myself. The messages are in romanian I don't think if this matters.



Re: I need help with my script - Georgelopez1 - 03.10.2010

Tell us whats wrong? Whats the compile say?


Re: I need help with my script - Steven82 - 03.10.2010

"Georgelopez1" don't try to help as you fail epicly on every topic you have posted in so far.

Anyways, i will help but as Mr.Fail above ^^^^^ said, whats the problem. If won't complie? It won't work? or what?


Re: I need help with my script - Georgelopez1 - 03.10.2010

Well maybe if you actually helped us we wouldn't ask so many questions/


Re: I need help with my script - steryman_007 - 04.10.2010

Chill up I just went offline cuz it was night @ me. So there are no errors in the compiler... the problem is that when I type those commands /sadmenu or /smokeanddrinksmenu the command is recognized but there is no dialog menu appeariang. Sorry that I forgot to post the problem.

LATER EDIT: Fixed! I reduced the dialog number id (D_B) and now works! The number was too big.