08.05.2013, 18:38
Dear!
I Already tried to ask from a friendly user, if he can see any problem in my code, but he says it is okay. But problem is still this:
This happens from the menu item. When entering to CP, it freezes a player automatically to prevent player moving out of CP. I'm trying to put a player to a chair and start the eating animation, but nothing happens and view keeps same as it is when scrolling in the menu (camera). Animation seems to work, tested it as a command.
Here is the code:
I Repeat that, the player is frozen, when he access the menu.
Thanks for your reply in advance, hopefully we can resolve this together!
Sincerely,
CrossUSAAF.
I Already tried to ask from a friendly user, if he can see any problem in my code, but he says it is okay. But problem is still this:
This happens from the menu item. When entering to CP, it freezes a player automatically to prevent player moving out of CP. I'm trying to put a player to a chair and start the eating animation, but nothing happens and view keeps same as it is when scrolling in the menu (camera). Animation seems to work, tested it as a command.
Here is the code:
pawn Код:
// On player selected menu row:
TogglePlayerControllable(playerid, 1);
SetPlayerVirtualWorld(playerid, 4);
SetPlayerPos(playerid, 450.6630, -90.9404, 999.7083);
SetCameraBehindPlayer(playerid);
SetPVarInt(playerid, "IsEating", 1);
new RandomHPP = random(51);
new Float:RandomHP = float(RandomHPP);
new Float:HP;
GetPlayerHealth(playerid, HP);
if(RandomHP + HP <= 100.0) SetPlayerHealth(playerid, HP + RandomHP);
if(RandomHP + HP > 100.0) SetPlayerHealth(playerid, 100.0);
ApplyAnimation(playerid, "FOOD", "FF_Sit_Eat1", 4.1, 1, 0, 0, 1, 0, 1);
SetTimerEx("StopEating", 10000, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
public StopEating(playerid)
{
if(GetPVarInt(playerid, "IsEating") == 1)
{
SetPVarInt(playerid, "IsEating", 0);
ClearAnimations(playerid, 1);
SetPlayerVirtualWorld(playerid, 4);
SetPlayerPos(playerid, 449.8693, -83.6513, 999.5547);
SetCameraBehindPlayer(playerid);
ShowMenuForPlayer(SarvShop, playerid);
}
}
Thanks for your reply in advance, hopefully we can resolve this together!
Sincerely,
CrossUSAAF.