Vehicle menu help :P
#1

Hi, i have the script for my own vehicle menu, its just i dont know how to get the vehicle to spawn and how to make it put the player in it at the players location! i will change the commands from teleports to vehicle spawn when i know how to :P

Here is the code, pls help:

Код:
#include <a_samp>

new Menu:OffroadVehicles;

#define FILTERSCRIPT

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n----------------------");
	print(" Cameron`s Vehicle menu!");
	print("----------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Cameron`s Vehicle menu!");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	OffroadVehicles = CreateMenu("Offroad Vehicles", 1,270,140,220,0);
	AddMenuItem(VehicleMenu1, 0, "Bandito");
	AddMenuItem(VehicleMenu1, 0, "BF Injection");
	AddMenuItem(VehicleMenu1, 0, "Dune");
	AddMenuItem(VehicleMenu1, 0, "Huntley");
	AddMenuItem(VehicleMenu1, 0, "Landstalker");
	AddMenuItem(VehicleMenu1, 0, "Mesa");
	AddMenuItem(VehicleMenu1, 0, "Monster");
	AddMenuItem(VehicleMenu1, 0, "Sandking");
	AddMenuItem(VehicleMenu1, 0, "Monster A");
	AddMenuItem(VehicleMenu1, 0, "Monster B");
	AddMenuItem(VehicleMenu1, 0, "Rancher");
	AddMenuItem(VehicleMenu1, 0, "Patriot");
	return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/menu1", true) == 0)
{
	  ShowMenuForPlayer(OffroadVehicles,playerid);
	  return 1;
}
	return 0;
}

if(CurrentMenu == OffroadVehicles)
{
  switch(row)
  {
    case 0: //Bandito
    {
      AddStaticVehicleEx()
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Grove Street");
    }
    case 1: //BF Injection
    {
      SetPlayerPos(playerid, 1541.2833, -1362.4741, 329.6457);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the top of Starfish Tower");
    }
    case 2: //Dune
    {
      SetPlayerPos(playerid, -2705.5503, 206.1621, 4.1797);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Wheel Arch Angels tuning-shop");
    }
    case 3: //Huntley
    {
      SetPlayerPos(playerid, -2617.5156, 1390.6353, 7.1105);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Jizzy's Nightclub!");
    }
    case 4: //Landstalker
    {
      SetPlayerPos(playerid, 2028.5538, 1008.3543, 10.8203);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Four Dragons Casino");
    }
    case 5: //Mesa
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
    case 6: //Monster
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
    case 7: //Sandking
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
    case 8: //Sandking
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
    case 9: //Monster A
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
    case 10: //Monster B
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
    case 11: //Rancher
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
    case 12: //Patriot
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
  }
Reply
#2

The limit of rows in one Menu is 12. You do have 12 rows but you have 13 rows in selection (case 0, 1, 2...12). That is the first problem.

Did you put this menu selection under OnPlayerSelectMenuRow? And did you even defined this CurrentMenu variable?
Reply
#3

Use PutPlayerInVehicle and CreateVehicle (****** it)
Reply
#4

Quote:
Originally Posted by SaW_[VrTx
]
Use PutPlayerInVehicle and CreateVehicle (****** it)
lol why ******? There is Wiki...
Reply
#5

i have been using the wiki to create the menu. please help me
Reply
#6

CAMERON_BANFIELD,

spawn code /

pawn Код:
new
Float:x,
Float:y,
Float:z,
Float:a;

GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
CreateVehicle(model,x+5,y+2,z,a,-1,-1,false);
Reply
#7

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)