13.05.2009, 23:38
ok i got a small food script
but the effect when selcting something doesnt work properly
need help
ok the menu stuff, filterscripinit
OnCommand
OnPlayerSelectedMenuRow
the script should actually be healing the player by 5 HP, since i do not know how to do that i done this
if you can heal the player by 5 can you show that and also comment on the line
when player types in the command, the player is froze and when the player buys soemthing or cancels the player is the unfroze
and when the player buys something it will cost the $5 aswell
any help?
when i do this, the script sets the player health to around 5-10 for some reason, but it does the last 2 functions(cash and toggle player control)
but the effect when selcting something doesnt work properly
need help
ok the menu stuff, filterscripinit
pawn Код:
pizzamenu = CreateMenu("Pizza", 2, 200.0, 100.0, 150.0);
AddMenuItem(pizzamenu, 0, "Magherita");
AddMenuItem(pizzamenu, 0, "Pepperoni");
AddMenuItem(pizzamenu, 0, "Meat Feast");
AddMenuItem(pizzamenu, 0, "Seafood Lovers");
AddMenuItem(pizzamenu, 0, "Vegetarian Hot One");
AddMenuItem(pizzamenu, 0, "Next");
AddMenuItem(pizzamenu, 1, "$5");
AddMenuItem(pizzamenu, 1, "$6");
AddMenuItem(pizzamenu, 1, "$8");
AddMenuItem(pizzamenu, 1, "$15");
AddMenuItem(pizzamenu, 1, "$7");
AddMenuItem(pizzamenu, 1, "Page");
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/foodmenu", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(pizzamenu,playerid);
TogglePlayerControllable(playerid,0);
return 1;
}
return 0;
}
pawn Код:
new Menu:Current2Menu = GetPlayerMenu(playerid);
if(Current2Menu == pizzamenu)
{
switch(row)
{
case 0:
{
new float:health;
health = GetPlayerHealth(playerid, health);
if(health > 95 && health <= 100)
{
SetPlayerHealth(playerid, 100.0);
}
else if(health > 90 && health <= 95)
{
SetPlayerHealth(playerid, 100.0);
}
else if(health > 85 && health <= 90)
{
SetPlayerHealth(playerid, 95.0);
}
else if(health > 80 && health <= 85)
{
SetPlayerHealth(playerid, 90.0);
}
else if(health > 75 && health <= 80)
{
SetPlayerHealth(playerid, 85.0);
}
else if(health > 70 && health <= 75)
{
SetPlayerHealth(playerid, 80.0);
}
else if(health > 65 && health <= 70)
{
SetPlayerHealth(playerid, 75.0);
}
else if(health > 60 && health <= 65)
{
SetPlayerHealth(playerid, 70.0);
}
else if(health > 55 && health <= 60)
{
SetPlayerHealth(playerid, 65.0);
}
else if(health > 50 && health <= 55)
{
SetPlayerHealth(playerid, 60.0);
}
else if(health > 45 && health <= 50)
{
SetPlayerHealth(playerid, 55.0);
}
else if(health > 40 && health <= 45)
{
SetPlayerHealth(playerid, 50.0);
}
else if(health > 35 && health <= 40)
{
SetPlayerHealth(playerid, 45.0);
}
else if(health > 30 && health <= 35)
{
SetPlayerHealth(playerid, 40.0);
}
else if(health > 25 && health <= 30)
{
SetPlayerHealth(playerid, 35.0);
}
else if(health > 20 && health <= 25)
{
SetPlayerHealth(playerid, 30.0);
}
else if(health > 15 && health <= 20)
{
SetPlayerHealth(playerid, 25.0);
}
else if(health > 10 && health <= 15)
{
SetPlayerHealth(playerid, 20.0);
}
else if(health > 5 && health <= 10)
{
SetPlayerHealth(playerid, 15.0);
}
else if(health > 0 && health <= 5)
{
SetPlayerHealth(playerid, 10.0);
}
GivePlayerMoney(playerid, -5);
TogglePlayerControllable(playerid,1);
if you can heal the player by 5 can you show that and also comment on the line
when player types in the command, the player is froze and when the player buys soemthing or cancels the player is the unfroze
and when the player buys something it will cost the $5 aswell
any help?
when i do this, the script sets the player health to around 5-10 for some reason, but it does the last 2 functions(cash and toggle player control)