naja da es schon etlich tut´s gibt durchsnitt
5/10 Brotfischpunkten
naja da es schon etlich tut´s gibt durchsnitt
5/10 Brotfischpunkten
Mensch chilla bist du denn..
da brauchst du kein command das Menü geht auf wenn du ins pickup rennst
Ja aber ich will das nicht mit pickup machen sondern mit nem befehl
Aber das funzt bei mir nicht Menu geht auf und wenn ich was ausgewählt habe bin ich immernoch freezed und ich bekomm dann auch nicht die sachen wie z.b. waffen oder es kommt auch kein text
EDIT: Hab bei meinenm ersten beitrag vergessen zu schreiben was bei mir nicht funzt xD
Machso so:
Oben:
new Menu:Skaten;
OnFilterscriptInit
Skaten = CreateMenu("Waffenmenü", 1, 50.0, 180.0, 200.0, 200.0);
AddMenuItem(Skaten, 0, "Waffe");
AddMenuItem(Skaten, 0, "Exit");
OnPlayerselectMenuRow
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == Skaten)
{
switch(row)
{
case 0:{
//Row 1 code
GivePlayerWeapon(playerid, 7, 50);
TogglePlayerControllable(playerid, true);
SendClientMessage(playerid, Rot, "Waffe");
}
case 1:{
//Row 2 code
TogglePlayerControllable(playerid, false);
}
}
}
return 1;
}
OnPlayercommand
{
if (strcmp("/menu", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(Skaten, playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
return 0;
}
Bin mir so halb sicher
Also gerade ich als anfänger der an seinem ersten Reallife Gamemode am arbeiten ist ist das eine sehr gutte erklärung.
Ich hatte vorher nie gechekt wass einer wenn er mir hilft über Teamviwher macht.
ich werd es ma versuchen THX
Is schon bissel älter aber versuche es trozdem mal^^...
Kann man das iwie so machen das wenn man dass Menue verlässt es auch weg bleibt bzw. das man iwie 10Sekunden Zeit hat da weg zu kommen?!
Kann mir einer Helfen? Das Menu Geht nicht
#include <a_samp>
new Gein, Gaus;
new Pein, Paus;
new GPein, GPaus;
new Wein, Waus;
new WaffenMenu;
new WaffenPICK;
public OnGameModeInit()
{
DisableInteriorEnterExits();
//Pickup
Gein = CreatePickup(1318, 2, 2539.1487,2790.9890,10.8203, -1);
Gaus = CreatePickup(1318, 2, 238.9117,139.2440,1003.0234, -1);
Pein = CreatePickup(1318, 2, 1555.2286,-1674.8322,16.1953, -1);
Paus = CreatePickup(1318, 2, 246.2067,62.2156,1003.6406, -1);
GPein = CreatePickup(1318, 2, 246.3761,87.9190,1003.6406, -1);
GPaus = CreatePickup(1318, 2, 1568.6259,-1689.9702,6.2188, -1);
Wein = CreatePickup(1318, 2, 1524.4877,-1677.3599,6.2188, -1);
Waus = CreatePickup(1318, 2, 286.3227,-41.8052,1001.5156, -1);
WaffenPICK = CreatePickup(1242, 2, 290.7124,-34.7458,1001.5156, -1);
//menu
{
WaffenMenu = CreateMenu("Waffen", 4, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(WaffenMenu, 0, "9mm");
AddMenuItem(WaffenMenu, 0, "Schlagstock");
AddMenuItem(WaffenMenu, 0, "Schrotflinte");
AddMenuItem(WaffenMenu, 0, "MP5");
}
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/show", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(WaffenMenu,playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
//Prisen
if(pickupid == Gein)
{
SetPlayerPos(playerid,238.6620,141.0520,1003.0234);
SetPlayerFacingAngle(playerid,0.0000);
SetPlayerInterior(playerid,3);
}
if(pickupid == Gaus)
{
SetPlayerPos(playerid,2539.2849,2788.9829,10.8203);
SetPlayerFacingAngle(playerid,149.4668);
SetPlayerInterior(playerid,0);
}
//Ein und Aus HQ
if(pickupid == Pein)
{
SetPlayerPos(playerid,246.7840,63.9002,1003.6406);
SetPlayerFacingAngle(playerid,0.0000);
SetPlayerInterior(playerid,6);
}
if(pickupid == Paus)
{
SetPlayerPos(playerid,1552.4500,-1674.9900,16.1953);
SetPlayerFacingAngle(playerid,90.0000);
SetPlayerInterior(playerid,0);
}
//Ein und Aus gan HQ und Gerasche
if(pickupid == GPein)
{
SetPlayerPos(playerid,1569.1481,-1692.6613,5.8906);
SetPlayerFacingAngle(playerid,151.3919);
SetPlayerInterior(playerid,0);
}
if(pickupid == GPaus)
{
SetPlayerPos(playerid,246.5363,85.9509,1003.6406);
SetPlayerFacingAngle(playerid,184.8450);
SetPlayerInterior(playerid,6);
}
//Waffenladen polize
if(pickupid == Wein)
{
SetPlayerPos(playerid,285.8537,-38.9897,1001.5156);
SetPlayerFacingAngle(playerid,359.9000);
SetPlayerInterior(playerid,1);
}
if(pickupid == Waus)
{
SetPlayerPos(playerid,1527.7048,-1676.9601,5.8906);
SetPlayerFacingAngle(playerid,261.8632);
SetPlayerInterior(playerid,0);
}
if(pickupid == WaffenPICK)
{
ShowMenuForPlayer(WaffenMenu,playerid);
TogglePlayerControllable(playerid, false);
}
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu==WaffenMenu)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 22, 50);
HideMenuForPlayer(WaffenMenu, playerid);
}
case 2:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 3, 1);
HideMenuForPlayer(WaffenMenu, playerid);
}
case 3:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 25, 50);
HideMenuForPlayer(WaffenMenu, playerid);
}
case 4:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 29, 50);
HideMenuForPlayer(WaffenMenu, playerid);
}
}
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
return 1;
}
Wird das Menü immer wieder geöffnet, oder was genau ist das Problem?
Falls das, dann:
Unter den Includes:
if(pickupid == WaffenPICK)
{
ShowMenuForPlayer(WaffenMenu,playerid);
TogglePlayerControllable(playerid, false);
}
zu:
if(pickupid == WaffenPICK)
{
if(blockedPickup[playerid]) return 1;
blockedPickup[playerid] = true;
ShowMenuForPlayer(WaffenMenu,playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
Und dann dort, wo du das Menü wieder hidest:
Wenn du nichts bewegen kannst, dann versuche es mal ohne den Spieler zu freezen.
wenn ich ins pickup gehe den ein noch unten gehe den geht es auto matich noch oben und manch man kann ich mich den gar nicht mehr bewegen
Dann mache es wie im Code von mir im Post drüber beschrieben.
das harbe ich versucht und es gehr nich ?? kannst du es mir schicken wie du es meinst??
So:
#include <a_samp>
new Gein, Gaus;
new Pein, Paus;
new GPein, GPaus;
new Wein, Waus;
new WaffenMenu;
new WaffenPICK;
new bool:blockedPickup[MAX_PLAYERS];
public OnGameModeInit()
{
DisableInteriorEnterExits();
//Pickup
Gein = CreatePickup(1318, 2, 2539.1487,2790.9890,10.8203, -1);
Gaus = CreatePickup(1318, 2, 238.9117,139.2440,1003.0234, -1);
Pein = CreatePickup(1318, 2, 1555.2286,-1674.8322,16.1953, -1);
Paus = CreatePickup(1318, 2, 246.2067,62.2156,1003.6406, -1);
GPein = CreatePickup(1318, 2, 246.3761,87.9190,1003.6406, -1);
GPaus = CreatePickup(1318, 2, 1568.6259,-1689.9702,6.2188, -1);
Wein = CreatePickup(1318, 2, 1524.4877,-1677.3599,6.2188, -1);
Waus = CreatePickup(1318, 2, 286.3227,-41.8052,1001.5156, -1);
WaffenPICK = CreatePickup(1242, 2, 290.7124,-34.7458,1001.5156, -1);
//menu
{
WaffenMenu = CreateMenu("Waffen", 4, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(WaffenMenu, 0, "9mm");
AddMenuItem(WaffenMenu, 0, "Schlagstock");
AddMenuItem(WaffenMenu, 0, "Schrotflinte");
AddMenuItem(WaffenMenu, 0, "MP5");
}
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/show", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(WaffenMenu,playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
//Prisen
if(pickupid == Gein)
{
SetPlayerPos(playerid,238.6620,141.0520,1003.0234);
SetPlayerFacingAngle(playerid,0.0000);
SetPlayerInterior(playerid,3);
}
if(pickupid == Gaus)
{
SetPlayerPos(playerid,2539.2849,2788.9829,10.8203);
SetPlayerFacingAngle(playerid,149.4668);
SetPlayerInterior(playerid,0);
}
//Ein und Aus HQ
if(pickupid == Pein)
{
SetPlayerPos(playerid,246.7840,63.9002,1003.6406);
SetPlayerFacingAngle(playerid,0.0000);
SetPlayerInterior(playerid,6);
}
if(pickupid == Paus)
{
SetPlayerPos(playerid,1552.4500,-1674.9900,16.1953);
SetPlayerFacingAngle(playerid,90.0000);
SetPlayerInterior(playerid,0);
}
//Ein und Aus gan HQ und Gerasche
if(pickupid == GPein)
{
SetPlayerPos(playerid,1569.1481,-1692.6613,5.8906);
SetPlayerFacingAngle(playerid,151.3919);
SetPlayerInterior(playerid,0);
}
if(pickupid == GPaus)
{
SetPlayerPos(playerid,246.5363,85.9509,1003.6406);
SetPlayerFacingAngle(playerid,184.8450);
SetPlayerInterior(playerid,6);
}
//Waffenladen polize
if(pickupid == Wein)
{
SetPlayerPos(playerid,285.8537,-38.9897,1001.5156);
SetPlayerFacingAngle(playerid,359.9000);
SetPlayerInterior(playerid,1);
}
if(pickupid == Waus)
{
SetPlayerPos(playerid,1527.7048,-1676.9601,5.8906);
SetPlayerFacingAngle(playerid,261.8632);
SetPlayerInterior(playerid,0);
}
if(pickupid == WaffenPICK)
{
if(blockedPickup[playerid]) return 1;
blockedPickup[playerid] = true;
ShowMenuForPlayer(WaffenMenu,playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu==WaffenMenu)
{
SetTimerEx("UnblockPickup", 1000, 0, "d", playerid);
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 22, 50);
HideMenuForPlayer(WaffenMenu, playerid);
}
case 2:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 3, 1);
HideMenuForPlayer(WaffenMenu, playerid);
}
case 3:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 25, 50);
HideMenuForPlayer(WaffenMenu, playerid);
}
case 4:
{
TogglePlayerControllable(playerid,true);
GivePlayerWeapon(playerid, 29, 50);
HideMenuForPlayer(WaffenMenu, playerid);
}
}
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
forward UnblockPickup(playerid);
public UnblockPickup(playerid)
{
blockedPickup[playerid] = false;
return 1;
}
Alles anzeigen
Ich habe noch einen Timer hinzugefügt, das ist dann wahrscheinlich noch etwas besser, da der Spieler mehr Zeit hat, sich vom Pickup zu entfernen.