new Menu:carmenu; new SpawnedVehicle[MAX_PLAYERS];
public OnGameModeInit() { carmenu = CreateMenu("CarMenu", 2, 200.0, 100.0, 150.0, 150.0); AddMenuItem(carmenu, 0, "Sultan"); AddMenuItem(carmenu, 0, "Savanna"); AddMenuItem(carmenu, 0, "Buffalo"); AddMenuItem(carmenu, 0, "Sentinel"); AddMenuItem(carmenu, 0, "Infernus"); AddMenuItem(carmenu, 1, "Cheetah"); AddMenuItem(carmenu, 1, "Ambulance"); AddMenuItem(carmenu, 1, "Leviathan"); AddMenuItem(carmenu, 1, "Esperanto"); AddMenuItem(carmenu, 1, "Banshee"); return 1; }
public OnPlayerSelectedMenuRow(playerid, row) { new Menu:CurrentMenu = GetPlayerMenu(playerid); if (CurrentMenu == carmenu) { switch(row) { case 0: // Sultan { new Float:X, Float:Y, Float:Z, Float:Angle; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); GetPlayerFacingAngle(playerid, Float:Angle); SpawnedVehicle[playerid] = CreateVehicle(560, X, Y + 5, Z + 2.0, Angle + 90.0, -1, -1, 600); SetVehicleVirtualWorld(SpawnedVehicle[playerid], GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(SpawnedVehicle[playerid], GetPlayerInterior(playerid)); } case 1: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 2: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 3: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 4: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 5: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 6: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 7: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 8: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } case 9: { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); CreateVehicle(560, X, Y + 5, Z + 2.0, 0, -1, -1, 1); } } } return 1; }
CMD:buycar(playerid, params[]) { ShowMenuForPlayer(carmenu,playerid); return 1; }
new CurrentMenu = GetPlayerMenu(playerid);
C:\Users\Andreas\Desktop\SAMP SERVER\DM Mode\gamemodes\Test.pwn(277) : warning 213: tag mismatch C:\Users\Andreas\Desktop\SAMP SERVER\DM Mode\gamemodes\Test.pwn(278) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
if(GetPlayerMenu(playerid) == ...)
Mh, okay, then try it without CurrentMenu, only
pawn Code:
|