ich will gerne checkpoints machen und wenn man reingeht wird ein menu angezeigt aber er wird immer nur ein checkpoint angezeigt könnte mir jemand zeigen wir ich 2 oder mehrere mache^^ wäre sehr dankbar hier ein teil des codes:
oben:
new Menu:stand;
new fest0;
new fest1;
new Menu:stand2;
ongameodeinit:
stand = CreateMenu("Stand", 1, 200.0, 100.0, 150.0, 150.0);
stand2 = CreateMenu("Zuckerwattenstand", 1, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(stand, 0, "Bratwurst");
AddMenuItem(stand, 0, "Doener");
AddMenuItem(stand, 0, "Bier");
AddMenuItem(stand, 0, "Cola");
AddMenuItem(stand2, 0, "Zuckerwatte");
Onplayerspawn:
fest0 = SetPlayerCheckpoint(playerid,360.6458,-2032.0608,7.8359, 1.0);
fest1 = SetPlayerCheckpoint(playerid,364.5151,-2020.5430,7.8359, 1.0);
OnPlayerentercheckpoint:
TogglePlayerControllable(playerid, false);
fest0 = ShowMenuForPlayer(stand,playerid);
fest1 = ShowMenuForPlayer(stand2,playerid);
onpalyerleavecheckpoint:
TogglePlayerControllable(playerid, true);
die letzten 2 callbacks:
public OnPlayerSelectedMenuRow(playerid, row)
{
new CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == stand)
{
switch(row)
{
case 0:
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, 0xFFFFFFFF, "Lecker Bratwurst =)");
TogglePlayerControllable(playerid, true);
}
case 1:
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, 0xFFFFFFFF, "Lecker Döner =)");
TogglePlayerControllable(playerid, true);
}
case 2:
{
SetPlayerHealth(playerid, 75.0);
SendClientMessage(playerid, 0xFFFFFFFF, "Alkohol ist nicht so gut!");
TogglePlayerControllable(playerid, true);
}
case 3:
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, 0xFFFFFFFF, "Cola ist besser als Alkohol^^");
TogglePlayerControllable(playerid, true);
}
}
if(CurrentMenu == stand2)
switch(row)
{
case 0:
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, 0xFFFFFFFF, "Lecker Zuckerwatte =)");
TogglePlayerControllable(playerid, true);
}
}
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
TogglePlayerControllable(playerid, true);
return 1;
}