SetCameraBehindPlayer(playerid);
// At OnGameModeInit
UsePlayerPedAnims(); // They must run like CJ now.
|
It appears as though the player's controllability is being toggled constantly between true and false. Look for "TogglePlayerControllable" in the code that brings up the textdraw or anywhere related to it; then post it here.
|
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid == INVALID_TEXT_DRAW)
{
for(new x = 0; x < 9; x++)
{
TextDrawHideForPlayer(playerid, Bank[x]);
TogglePlayerControllable(playerid, true);
TextDrawHideForPlayer(playerid, Market_BLACK[x]);
}
HideBizzMenu(playerid);
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
TogglePlayerControllable(playerid, false);
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
TogglePlayerControllable(playerid, true);
}
CMD:buy(playerid, params[])
{
new bizzid = Tmp_P[playerid][InsideBizz];
if(bizzid != -1)
{
new Float:Pos[3];
GetBizzBuyingPoint(bizzid, Pos[0], Pos[1], Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, Pos[0], Pos[1], Pos[2]))
{
new type = Bizz[bizzid][BizzType];
ShowBizzMenu(playerid, type);
}
else return SendClientMessage(playerid, RED, "[ERROR]"COL_WHITE"You need to be near the cashier to use this command! ");
}
else
{
for(new x=0; x < MAX_BUSINESSES; x++)
{
if(Bizz[x][BizzType] == BIZZ_TYPE_VENDOR)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, Bizz[x][BizzEntry][0], Bizz[x][BizzEntry][1], Bizz[x][BizzEntry][2]))
{
ShowBizzMenu(playerid, BIZZ_TYPE_VENDOR);
}
}
}
}
return 1;
}
stock ShowBizzMenu(playerid, bizztype)
{
for(new x=0; x < 5; x++)
{
TextDrawShowForPlayer(playerid, Shopping[x]);
}
if(bizztype == BIZZ_TYPE_VENDOR)
{
for(new x=0; x <6; x++)
{
TextDrawShowForPlayer(playerid, VendorItems[x]);
}
}
else if(bizztype == BIZZ_TYPE_24X7)
{
for(new x=0; x < 6; x++)
{
TextDrawShowForPlayer(playerid, HoursItems[x]);
}
}
else if(bizztype == BIZZ_TYPE_FASTFOOD)
{
for(new x=0; x < 6; x++)
{
TextDrawShowForPlayer(playerid, FastfoodItems[x]);
}
}
SelectTextDraw(playerid, GREEN);
return 1;
}
stock HideBizzMenu(playerid)
{
for(new x=0; x < 5; x++)
{
TextDrawHideForPlayer(playerid, Shopping[x]);
}
for(new x=0; x < 6; x++)
{
TextDrawHideForPlayer(playerid, HoursItems[x]);
TextDrawHideForPlayer(playerid, VendorItems[x]);
TextDrawHideForPlayer(playerid, FastfoodItems[x]);
}
CancelSelectTextDraw(playerid);
return 1;
}
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
TogglePlayerControllable(playerid, false);
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
TogglePlayerControllable(playerid, true);