ApplyAnimation(playerid, "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0);
forward RecHP(playerid);
public RecHP(playerid)
{
SetPlayerHealth(playerid, 100);
return 1;
}
//No Comando Ou Outro Local do Mode
SetTimerEx("RecHP", 30000, false, "i", playerid);
//No Comando Ou Outro Local do Mode
SetTimerEx("RecHP", 30000, false, "i", playerid);
#include <a_samp>
new Timer;
new bool:Descansando[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" FS by CidadeNovaRP ¬¬");
print("--------------------------------------\n");
return 1;
}
public OnPlayerConnect(playerid)
{
Pos(playerid);
return 1;
}
forward Pos(playerid);
public Pos(playerid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPVarFloat(playerid, "X", x);
SetPVarFloat(playerid, "Y", y);
SetPVarFloat(playerid, "Z", z);
SetTimerEx("HP", 30000, false, "i", playerid);
return 1;
}
forward HP(playerid);
public HP(playerid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(GetPVarFloat(playerid,"X") == x && GetPVarFloat(playerid,"Y") == y && GetPVarFloat(playerid,"Z") == z)
{
if(Descansando[playerid] == false)
{
Descansando[playerid] = true;
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0);
Timer = SetTimerEx("DarHP", 1000, true, "i", playerid);
SendClientMessage(playerid, -1, "~~~> Aperte 'F'ou 'Enter' para Levantar-se <~~~");
}
}
else
{
Pos(playerid);
}
return 1;
}
forward DarHP(playerid);
public DarHP(playerid)
{
if(Descansando[playerid] == true)
{
new Float:NewHealth;
GetPlayerHealth(playerid, NewHealth);
SetPlayerHealth(playerid, NewHealth+1);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(Descansando[playerid] == true)
{
Descansando[playerid] = false;
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
KillTimer(Timer);
Pos(playerid);
}
}
return 1;
}
Cara funcionou de boa! Valeu cara.. vc й novo no server mas jб й mto inteligente, parabens cara!! Valeu mto.
sу n dou mais rep pq n da pra dar mais! |