Menu Problem
#1

When i try to exit the menus in my gamemode they just load back up. Ive attached one of my menus .
Quote:

Ongamemodeinit()
stuntzones = CreateMenu("StuntZones", 1, 0.0, 150.0, 150);
AddMenuItem(stuntzones, 0, "LSAir");
AddMenuItem(stuntzones, 0, "Bigjump1");
AddMenuItem(stuntzones, 0, "Boneyard");
AddMenuItem(stuntzones, 0, "LVAir");
AddMenuItem(stuntzones, 0, "BigJump2");
AddMenuItem(stuntzones, 0, "PipeJump1");
AddMenuItem(stuntzones, 0, "Chiliad");

Quote:

OnGameModeExit
DestroyMenu(stuntzones);

Quote:

OnPlayerCommand
if(strcmp(cmdtext, "/stunt", true) == 0)
{
TogglePlayerControllable(playerid, false);
ShowMenuForPlayer(stuntzones,playerid);
}
return 1;

Quote:

OnPlayerSelectedMenuRow
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == stuntzones)
{
switch(row)
{
case 0: //LS AIR
{
TogglePlayerControllable(playerid, true);
SetPlayerInterior(playerid, 0);
printf(" %d has teleported to /lsair ", playerid);
SendClientMessage(playerid, COLOR_GREEN, "-LSAIR- By Fallen");
new State = GetPlayerState(playerid);
new cartype = GetPlayerVehicleID(playerid);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,1929.2516,-2353.0620,16.988;
SetPlayerFacingAngle(playerid,221);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,1929.2516,-2353.0620,16.988;
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,1929.2516,-2353.0620,16.988;
SetPlayerFacingAngle(playerid,221);}
}
case 1: //BIG Jump
{
TogglePlayerControllable(playerid, true);
SetPlayerInterior(playerid, 0);
printf(" %d has teleported to /bigjump1 ", playerid);
SendClientMessage(playerid, COLOR_GREEN, "-BigJump1- By Fallen");
new State = GetPlayerState(playerid);
new cartype = GetPlayerVehicleID(playerid);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,944.5399,-2484.1819,374.4733);
SetPlayerFacingAngle(playerid,221);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,944.5399,-2484.1819,374.4733);
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,944.5399,-2484.1819,374.4733);
SetPlayerFacingAngle(playerid,221);}
}
case 2: //Boneyard
{
TogglePlayerControllable(playerid, true);
SetPlayerInterior(playerid, 0);
printf(" %d has teleported to /boneyard ", playerid);
SendClientMessage(playerid, COLOR_GREEN, "-BoneYard- By Fallen");
new State = GetPlayerState(playerid);
new cartype = GetPlayerVehicleID(playerid);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,403.7476,2450.8909,16.5000) ;
SetPlayerFacingAngle(playerid,221);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,403.7476,2450.8909,16.5000) ;
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,403.7476,2450.8909,16.5000) ;
SetPlayerFacingAngle(playerid,221);}
}
case 3: //LVAir
{
TogglePlayerControllable(playerid, true);
SetPlayerInterior(playerid, 0);
printf(" %d has teleported to /boneyard ", playerid);
SendClientMessage(playerid, COLOR_GREEN, "-LV Air- By Big_Steve and Fallen");
new State = GetPlayerState(playerid);
new cartype = GetPlayerVehicleID(playerid);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,1496.3123,1467.3372,10.8203 );
SetPlayerFacingAngle(playerid,221);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,1496.3123,1467.3372,10.8203 );
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,1496.3123,1467.3372,10.8203 );
SetPlayerFacingAngle(playerid,221);}
}
case 4: //BigJump2
{
TogglePlayerControllable(playerid, true);
SetPlayerInterior(playerid, 0);
printf(" %d has teleported to /boneyard ", playerid);
SendClientMessage(playerid, COLOR_GREEN, "-BigJump2- By Fallen");
new State = GetPlayerState(playerid);
new cartype = GetPlayerVehicleID(playerid);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,1476.5007,2504.8489,389.926 9);
SetPlayerFacingAngle(playerid,221);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,1476.5007,2504.8489,389.926 9);
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,1476.5007,2504.8489,389.926 9);
SetPlayerFacingAngle(playerid,221);}
}
case 5: //PipeJump1
{
TogglePlayerControllable(playerid, true);
SetPlayerInterior(playerid, 0);
printf(" %d has teleported to /boneyard ", playerid);
SendClientMessage(playerid, COLOR_GREEN, "-PipeJump1- By Fallen");
new State = GetPlayerState(playerid);
new cartype = GetPlayerVehicleID(playerid);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,1496.6938,1180.5635,119.718 1);
SetPlayerFacingAngle(playerid,221);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,1496.6938,1180.5635,119.718 1);
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,1496.6938,1180.5635,119.718 1);
SetPlayerFacingAngle(playerid,221);}
}
case 6: //Chilidad
{
TogglePlayerControllable(playerid, true);
SetPlayerInterior(playerid, 0);
printf(" %d has teleported to /Chilidad ", playerid);
SendClientMessage(playerid, COLOR_GREEN, "-Chilidad- By Fallen");
new State = GetPlayerState(playerid);
new cartype = GetPlayerVehicleID(playerid);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,-2348.9729,-1627.3823,483.6770);
SetPlayerFacingAngle(playerid,221);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,-2348.9729,-1627.3823,483.6770);
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,-2348.9729,-1627.3823,483.6770);
SetPlayerFacingAngle(playerid,221);}
}
}
}

Quote:

OnPlayerExitedMenu
{
TogglePlayerControllable(playerid, 1); // after menu exiting Player will be controllable back!
}

So yeah, any help would be greatly appreciated. Ive tried taking out the returns , but that dosent work.

As you can probably see im still pretty noob at coding, but im trying to get better =]

Reply
#2

bump, plz help ?
Reply
#3

maybe HideMenuForPlayer(stuntzones, playerid); for every tele?
Reply
#4

yeah they hide if you teleport, the problem is if you dont want to teleport :/
Reply
#5

bump.d

anyone ? =[
Reply
#6

do you used
Destroy menu:menu1
and so==on
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)