Help with scripting a drive thru
#1

Don't laugh at my shit this is literally my 1st day of scripting and all that I've "learned" so far is from reading what people said on here lol.I have nothing to do during winter so I decided to take up scripting and see how far I go with it and honestly so far I won't say that it's going smooth lol but hey everyone has their noob days

On to what I need help with:

I'm trying to script a drive-thru system for the 4 major restaurants in Los Santos, I have all the co-ordinates and the problems I have encountered with are written in the file and also I have no idea if there are any bugs present so please fix that as well to anyone who will be kind enough to help me out :)

I didn't finish the entire thing due to the fact that rest of the menu is just copy+pasting and changing some messages but I'll get to it as soon as I get my shit going proper


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/drivethru", true) == 0)
	{
	if(IsPlayerInAnyVehicle(playerid) SendClientMessage(playerid,0xFFFFFFFF,"(00FFFF)Please place your order!")
	else SendClientMessage(playerid, 0xFFFFFFFF,"(00FFFF)You can only order from here if you're in a vehicle!Go inside if you're on foot!")
	(
	  GetPlayerPos(playerid, pos);
	  if(IsPlayerInRangeofPoint(playerid, 2375.9019,-1908.5901,13.3828);
	  else SendClientMessage(playerid,"(00FFFF)You are not at the drive-thru"
//idk if this shit works lol just typed it out and hoped for the best
		ShowPlayerDialog(playerid, 20, DIALOG_STYLE_LIST, "Menu", "Medium-sized Chicken Burger(15) \n Cheeseburger(18) \n French Fries(25) \n Water(5) \n Large Burger(35) \n Chicken Wings(50) \n Coca-Cola(20) \n Sprite(20) \n ", "Select", "Cancel");
		return 1;
	}
	return 0;
}

if(listitem == 1)// 'Medium-sized Chicken Burger'
			{
			    GetPlayerMoney(playerid, money);
                if(money > 15) GivePlayerMoney(playerid, - 15);
                else SendClientMessage(playerid, "(FF0000)Looks like you're broke, sorry but we don't serve food for free!Go find someone else and get a job!")
			    GetPlayerHealth(playerid, health);
				health = (health+50);
				if(health > 100) SetPlayerHealth(playerid, +5);
  				else SetPlayerHealth(playerid, health );
				SendClientMessage(playerid,0xFFFFFFFF,"(00FFFF)Here you go!Have a nice meal and don't forget to come again!")
			   //idk how to type a /me here for like players in range, *The cashier extends his hand and quickly hands a medium-sized cheeseburger over - smiling widely.
				ProxDetector(10.0, playerid, message, -1); //thats the range thing, i have a problem with this as well, this is supposed be directed at the cashier's message
				TogglePlayerControllable(playerid,1);
			}
return 0;
and also this thing is written for the Cluckin Bell in Willowfield, if I want to make the same type of drive thru for the Burger Shot in Richman do I just need to change the co-ordinates of the point the player needs to be in?Will the script accept the same command in different places?


I can help out someone with beat making in exchange I've been fucking around with that for 5 years but I doubt there are any producers around here lol
Reply
#2

I would Suggest you to use the right tag.

if(IsPlayerInRangeofPoint(playerid, 2375.9019,-1908.5901,13.382;

Go to pawno, type this one by one,don't copy-paste.

IsPlayerInRangeOfPoint(

then wait,at top there will be a box,it tells you the syntax to write!
Reply
#3

Thanks my dude

and big ups for the signature, "End of Days" by vinnie is an ill track
Reply
#4

dude just an advice never use Strcmp and look out for ");" because you miss them and for "}" too.
Reply
#5

Quote:
Originally Posted by jNkk
Посмотреть сообщение
dude just an advice never use Strcmp and look out for ");" because you miss them and for "}" too.
I'll fix the brackets as soon as possible and to be quite honest, for the strcmp thing I just searched for how to check if a player typed a command and what does the command do, if that makes any sense lol

But I appreciate the smallest help I can get, good looking out!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)