23/09/2023 18:54
(Esta mensagem foi modificada pela última vez a: 24/09/2023 00:40 por White_Blue.)
se ficou confuso pra alguém você primeiro tem que aplicar a animação do ped sentando depois você liga o air bake ativa o modo lento dele e arrasta o ped pra cadeira depois aplica a animação do ped levantando seu ped vai ficar na posição certa de sentar e levantar você salva a sua posição e já era na animação da comida você tem que usar a posição do objeto da cadeira pra o ped poder ficar sentado
o que foi usado no video
Código PHP:
CMD:r(playerid, params[]) return ApplyAnimation(playerid, "FOOD", "FF_Sit_In_R", 4.1, 0, 0, 0, 1, 0);
CMD:rout(playerid, params[]) return ApplyAnimation(playerid, "FOOD", "FF_Sit_Out_R_180", 4.0, 0, 1, 1, 0, 0);
CMD:l(playerid, params[]) return ApplyAnimation(playerid, "FOOD", "FF_Sit_In_L", 4.1, 0, 0, 0, 1, 0);
CMD:lout(playerid, params[]) return ApplyAnimation(playerid, "FOOD", "FF_Sit_Out_L_180", 4.0, 0, 1, 1, 0, 0);
CMD:f(playerid, params[]) return ApplyAnimation(playerid, "FOOD", "FF_Sit_Eat1", 4.1, 0, 0, 0, 1, 0);
ApplyAnimation(playerid, "FOOD", "FF_Sit_In_R", 4.1, 0, 0, 0, 1, 0);
ApplyAnimation(playerid, "FOOD", "FF_Sit_Out_R_180", 4.0, 0, 1, 1, 0, 0);
ApplyAnimation(playerid, "FOOD", "FF_Sit_In_L", 4.1, 0, 0, 0, 1, 0);
ApplyAnimation(playerid, "FOOD", "FF_Sit_Out_L_180", 4.0, 0, 1, 1, 0, 0);
SetPlayerAttachedObject(playerid,0,2880,6,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
new eating0[MAX_PLAYERS];
forward eat0(playerid);
new eating1[MAX_PLAYERS];
forward eat1(playerid);
new eating2[MAX_PLAYERS];
forward eat2(playerid);
new eating3[MAX_PLAYERS];
forward eat3(playerid);
new eating4[MAX_PLAYERS];
forward eat4(playerid);
new Sentado[MAX_PLAYERS];
new contar[MAX_PLAYERS];
CMD:comer(playerid, params[])
{
Sentado[playerid] = 1;
SetPlayerPos(playerid, 812.16058, -1612.00122, 13.07880); // posição do objeto da cadeira na rua
ApplyAnimation(playerid, "FOOD", "FF_Sit_Eat1", 4.1, 0, 0, 0, 1, 0);
SetPlayerAttachedObject(playerid,0,2880,6,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
eating0[playerid] = SetTimerEx("eat0", 1000, true, "i", playerid);
return 1;
}
CMD:sentar(playerid, params[])
{
if(Sentado[playerid] == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 812.0838, -1612.9688, 13.5873))
{
SetPlayerPos(playerid, 812.0838, -1612.9688, 13.5873);
SetPlayerFacingAngle(playerid, 265.0771);
ApplyAnimation(playerid, "FOOD", "FF_Sit_In_R", 4.1, 0, 0, 0, 1, 0);
Sentado[playerid] = 1;
}
}
return 1;
}
CMD:levantar(playerid, params[])
{
if(Sentado[playerid] == 1)
{
ApplyAnimation(playerid, "FOOD", "FF_Sit_Out_R_180", 4.0, 0, 1, 1, 0, 0);
RemovePlayerAttachedObject(playerid, 0);
Sentado[playerid] = 0;
}
return 1;
}
public eat0(playerid)
{
contar[playerid]++;
ApplyAnimation(playerid, "FOOD", "FF_Sit_Eat1", 4.1, 0, 0, 0, 1, 0);
if(contar[playerid] >= 20)
{
contar[playerid] = 0;
KillTimer(eating0[playerid]);
eating1[playerid] = SetTimerEx("eat1", 2000, true, "i", playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);
PlayerPlaySound(playerid, 32200, X, Y, Z);
}
return 1;
}
public eat1(playerid)
{
contar[playerid]++;
ApplyAnimation(playerid, "FOOD", "FF_Sit_Eat2", 4.1, 0, 0, 0, 1, 0);
if(contar[playerid] >= 20)
{
contar[playerid] = 0;
KillTimer(eating1[playerid]);
eating2[playerid] = SetTimerEx("eat2", 2000, true, "i", playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);
PlayerPlaySound(playerid, 32200, X, Y, Z);
}
return 1;
}
public eat2(playerid)
{
contar[playerid]++;
ApplyAnimation(playerid, "FOOD", "FF_Sit_Eat3", 4.1, 0, 0, 0, 1, 0);
if(contar[playerid] >= 20)
{
contar[playerid] = 0;
KillTimer(eating2[playerid]);
eating3[playerid] = SetTimerEx("eat3", 2000, true, "i", playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);
PlayerPlaySound(playerid, 32200, X, Y, Z);
}
return 1;
}
public eat3(playerid)
{
contar[playerid]++;
ApplyAnimation(playerid, "FOOD", "FF_Sit_Look", 4.0, 0, 0, 0, 1, 0);
if(contar[playerid] >= 10)
{
contar[playerid] = 0;
KillTimer(eating3[playerid]);
eating4[playerid] = SetTimerEx("eat4", 2000, true, "i", playerid);
}
return 1;
}
public eat4(playerid)
{
contar[playerid]++;
ApplyAnimation(playerid, "FOOD", "FF_Sit_Loop", 4.0, 0, 0, 0, 1, 0);
if(contar[playerid] >= 10)
{
contar[playerid] = 0;
KillTimer(eating4[playerid]);
RemovePlayerAttachedObject(playerid,0);
iseating[playerid] = false;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);
PlayerPlaySound(playerid, 6401, X, Y, Z); //
}
return 1;
}