Hallo liebe Bradfish User,
Ich wünche mir ein Befehl den ich im BSN Butzen kann,
An dieser Stelle
376.3494,-67.9245,1001.5151
sollte man den Befehl /menu eingeben, wenn man den /befehl eingegeben hat sollte sich ein Menu Öffnen in dem man sich Esses und Getränke Kaufen kann
Das Menü sollte so aussehen
*Speisen*
- Hamburger - 100$
- Cürry Wurst - 80 $
- Pommes - 60 $
*Getränke*
- CocaCola - 50$
- Fanta - 50 $
- Mixery - 60$
- Urpils - 60 $
Wenn man Was auswählt der aufgelisteten Sachen sollte das Leben Aufgefüllt werden:
*Speisen*
Hamburger 30% Leben
Cürry Wurst 40% Leben
Pommes 20 % Leben
*Getränke*
CocaCola 15% Leben
Fanta 15% Leben
Mixery 18% Leben + Alkohol Efekkt
Urpils 17% Leben + Alkohol Efekkt
Wenn man Was isst wird man für 5 Sekunden Gefrezzed und wenn man was Isst sollte man 3 Sekunden Gefreezet Werden
Ich würde mich Sehr Freuen wenn mir jemand solch ein Code machen kann
Schonmal Danke im Vorraus mfg. AmoK
BSN MENÜ
- SHORE
- Geschlossen
- Erledigt
-
-
Wenn man Was isst wird man für 5 Sekunden Gefrezzed und wenn man was Isst sollte man 3 Sekunden Gefreezet Werden
Hä?
-
Ups xD wenn man was isst wird man für 5 sekunden gefreezed und wenn man was Trinkt wird man für 3 sekunden Gefreezed xD
-
eigendlich garnet so schwer:
http://forum.sa-mp.com/index.php?topic=44596.0
da machste ins script ambesten
new MenuHealth = 0;
forward MenuFreeze;
dann fügste einfach unter "Edit Code" einGetPlayerHealth(playerid, MenuHealth);
MenuHealth += /*Dein gewünschtes Leben*/;
SetPlayerHealth(playerid, MenuHealth);
GivePlayerMoney(playerid, -/*Preis*/); // das mit dem "-" weis ich net obs klappt
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0); // beim Trinken die 5000 durch 3000 ersetzen. 5000 sind 5 sekpublic MenuFreeze
{
TogglePlayerControllable(playerid, 1);
}und dann halt immer anpassen
-
Mein wunsch ist ja das mir den Code jemand macht Komplett das ich nich mehr machen Brauch xD
-
in Arbeitung
ähmmm was meinst du mit 30% leben? ich bräuchte da eine genaue angabe
Nachdem ich keine Angaben bekommen habe musst es halt selber einfügen. weis nicht genau ob es mit + und - klappt aba sollte eigendlich schon
new Menu:BSN Menu;
new MenuHealth[MAX_PLAYERS];forward MenuFreeze(playerid);
public OnGameModeInit()
{
BSN Menu = CreateMenu("BSNMenu", 2, 50.0, 180.0, 200.0, 200.0);AddMenuItem(BSN Menu, 0, "Hamburger");
AddMenuItem(BSN Menu, 1, "100 Dollar");
AddMenuItem(BSN Menu, 0, "Cürry Wurst");
AddMenuItem(BSN Menu, 1, "80 Dollar");
AddMenuItem(BSN Menu, 0, "Pommes");
AddMenuItem(BSN Menu, 1, "60 Dollar");
AddMenuItem(BSN Menu, 0, "CocaCola");
AddMenuItem(BSN Menu, 1, "50 Dollar");
AddMenuItem(BSN Menu, 0, "Fanta");
AddMenuItem(BSN Menu, 1, "50 Dollar");
AddMenuItem(BSN Menu, 0, "Mixery");
AddMenuItem(BSN Menu, 1, "60 Dollar");
AddMenuItem(BSN Menu, 0, "Urpils");
AddMenuItem(BSN Menu, 1, "60 Dollar");
return 1;
}public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/menu", true) == 0)
{
if (PlayerToPoint(2, playerid, 376.3494, -67.9245, 1001.5151))
{
ShowMenuForPlayer(BSN Meals, playerid);
}
}
return 1;
}public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == BSN Menu)
{
switch(row)
{
case 0:
{
SetPlayerHealth(playerid, +);
GivePlayerMoney(playerid, -100);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 1:
{
SetPlayerHealth(playerid, +);
GivePlayerMoney(playerid, -80);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 2:
{
SetPlayerHealth(playerid, +);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 3:
{
SetPlayerHealth(playerid, +);
GivePlayerMoney(playerid, -50);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 4:
{
SetPlayerHealth(playerid, +);
GivePlayerMoney(playerid, -50);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 5:
{
SetPlayerHealth(playerid, +);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 6:
{
SetPlayerHealth(playerid, +);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
}
}
return 1;
}public MenuFreeze(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
} -
Ich meine mit 30% Leben das sich das leben um 30% erröht wenn man dieses Menuitem auswählt xD
-
ja schon aba wie soll ich das machen? ich weis net obs mit
GivePlayerHealth(playerid, x= 1.3);
funktioniert. auserdem wenn jetzt jemand mit 1 Health daher kommt kann er soviel futtern wie er will und bekommt nix.
Mach lieber 30 Health oda so. -
oder mach es sp
new Float:health;
SetPlayerHealth(playerid, health + 30.0);ist nicht getestet müsste aber gehen
-
Woher soll bitte der Wert von health rausgefunden werden in deinem Code?
So muss es sein:
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+30.0); -
jo stimmt hast recht habe ich gerade getestet habe getplayerhalth vergessen
-
Es lässt sich nicht Compilen
-
habs auch probiert bekomme error bei Compiler
-
Help xD
-
kann mal jemand den richtigen code ohne errors posten were echt nett
-
ich probier es mal aus
Bitte warten...
-
Wer macht ne Variable mit Leerzeichen drin???
-
ja marcell is mir au aufgefallen als ich es ausprobiert hab
Hier der Code, sollte klappen. 0 Errors 0 Erfolgserscheinung XD
new Menu:BSNMenu;
forward MenuFreeze(playerid);
public OnGameModeInit()
{
BSNMenu = CreateMenu("BSNMenu", 2, 50.0, 180.0, 200.0, 200.0);AddMenuItem(BSNMenu, 0, "Hamburger");
AddMenuItem(BSNMenu, 1, "100 Dollar");
AddMenuItem(BSNMenu, 0, "Cürry Wurst");
AddMenuItem(BSNMenu, 1, "80 Dollar");
AddMenuItem(BSNMenu, 0, "Pommes");
AddMenuItem(BSNMenu, 1, "60 Dollar");
AddMenuItem(BSNMenu, 0, "CocaCola");
AddMenuItem(BSNMenu, 1, "50 Dollar");
AddMenuItem(BSNMenu, 0, "Fanta");
AddMenuItem(BSNMenu, 1, "50 Dollar");
AddMenuItem(BSNMenu, 0, "Mixery");
AddMenuItem(BSNMenu, 1, "60 Dollar");
AddMenuItem(BSNMenu, 0, "Urpils");
AddMenuItem(BSNMenu, 1, "60 Dollar");
return 1;
}public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/menu", true) == 0)
{
if (PlayerToPoint(2, playerid, 376.3494, -67.9245, 1001.5151))
{
ShowMenuForPlayer(BSNMenu, playerid);
}
return 1;
}
return 0;
}public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == BSNMenu)
{
new Float:health;
switch(row)
{
case 0:
{
GetPlayerHealth(playerid, health);
health *= 1.3;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -100);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 1:
{
GetPlayerHealth(playerid, health);
health *= 1.4;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -80);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 2:
{
GetPlayerHealth(playerid, health);
health *= 1.2;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 3:
{
GetPlayerHealth(playerid, health);
health *= 1.15;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -50);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 4:
{
GetPlayerHealth(playerid, health);
health *= 1.15;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -50);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 5:
{
GetPlayerHealth(playerid, health);
health *= 1.18;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 6:
{
GetPlayerHealth(playerid, health);
health *= 1.17;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
}
}
return 1;
}public MenuFreeze(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
} -
so gehts 100%.
new Menu:BSNMenu;
forward MenuFreeze(playerid);
public OnGameModeInit()
{
BSNMenu = CreateMenu("BSNMenu", 2, 50.0, 180.0, 200.0, 200.0);AddMenuItem(Menu:BSNMenu, 0, "Hamburger");
AddMenuItem(Menu:BSNMenu, 1, "100 Dollar");
AddMenuItem(Menu:BSNMenu, 0, "Cürry Wurst");
AddMenuItem(Menu:BSNMenu, 1, "80 Dollar");
AddMenuItem(Menu:BSNMenu, 0, "Pommes");
AddMenuItem(Menu:BSNMenu, 1, "60 Dollar");
AddMenuItem(Menu:BSNMenu, 0, "CocaCola");
AddMenuItem(Menu:BSNMenu, 1, "50 Dollar");
AddMenuItem(Menu:BSNMenu, 0, "Fanta");
AddMenuItem(Menu:BSNMenu, 1, "50 Dollar");
AddMenuItem(Menu:BSNMenu, 0, "Mixery");
AddMenuItem(Menu:BSNMenu, 1, "60 Dollar");
AddMenuItem(Menu:BSNMenu, 0, "Urpils");
AddMenuItem(Menu:BSNMenu, 1, "60 Dollar");
return 1;
}public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/menu", true) == 0)
{
if (PlayerToPoint(2, playerid, 376.3494, -67.9245, 1001.5151))
{
ShowMenuForPlayer(Menu:BSNMenu, playerid);
}
return 1;
}
return 0;
}public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == BSNMenu)
{
new Float:health;
switch(row)
{
case 0:
{
GetPlayerHealth(playerid, health);
health *= 1.3;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -100);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 1:
{
GetPlayerHealth(playerid, health);
health *= 1.4;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -80);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 2:
{
GetPlayerHealth(playerid, health);
health *= 1.2;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 5000, 0);
}
case 3:
{
GetPlayerHealth(playerid, health);
health *= 1.15;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -50);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 4:
{
GetPlayerHealth(playerid, health);
health *= 1.15;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -50);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 5:
{
GetPlayerHealth(playerid, health);
health *= 1.18;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
case 6:
{
GetPlayerHealth(playerid, health);
health *= 1.17;
SetPlayerHealth(playerid, health);
GivePlayerMoney(playerid, -60);
TogglePlayerControllable(playerid, 0);
SetTimer("MenuFreeze", 3000, 0);
}
}
}
return 1;
}public MenuFreeze(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
} -
hast du was geändert? wenn ja was?
-