Pages

Ads 468x60px


[FilterScript] Sistema de "Descanso"

Mais um "sistemoide" bem Simples que usei para ajudar um mano em outro Tópico, é bem SIMPLES mas espero que gostem :
pawn Code:
#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);         if(NewHealth <= 100)         {             SetPlayerHealth(playerid, NewHealth+1);         }         else         {             Descansando[playerid] = false;             TogglePlayerControllable(playerid, 1);             ClearAnimations(playerid);             KillTimer(Timer);             Pos(playerid);         }     }     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; } public OnPlayerDisconnect(playerid, reason) {     Descansando[playerid] = false;     TogglePlayerControllable(playerid, 1);     ClearAnimations(playerid);     KillTimer(Timer);     Pos(playerid);     return 1; } public OnPlayerDeath(playerid, killerid, reason) {     Descansando[playerid] = false;     TogglePlayerControllable(playerid, 1);     ClearAnimations(playerid);     KillTimer(Timer);     Pos(playerid);     return 1; } public OnPlayerSpawn(playerid) {     Descansando[playerid] = false;     TogglePlayerControllable(playerid, 1);     ClearAnimations(playerid);     KillTimer(Timer);     Pos(playerid);     return 1; }