26.07.2009, 11:42
I figured it out
This works..hope it ts not gonna be buggy when more players join
This works..hope it ts not gonna be buggy when more players join
Код:
new Float:faPlayerHealth[MAX_PLAYERS]; public OnPlayerUpdate(playerid) // { new Float:fHealth; GetPlayerHealth(playerid, fHealth); if(fHealth != faPlayerHealth[playerid]) { //SendClientMessage(playerid, 0xFF000096, "thingy1!"); // Player health has changed since last update from player -> server, so obviously thats the thing updated. // Lets do further checks see if he've lost or gain health, anti health cheat? ;-) if(fHealth > faPlayerHealth[playerid]) { SendClientMessage(playerid, 0xFFFF0096, "You gained health!"); /* He've gained health! Cheating? Write your own scripts here to figure how a player gained health! */ } else { new Float:health; if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) GetPlayerHealth(playerid,health); if (health < 70.0) { ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 0, 0, 0, 0, 0); // Dead Crawling SendClientMessage(playerid, 0xFF000096, "you better call an ambulance!"); /* He've lost health! */ //ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 0, 0, 0, 0, 0); // Injured } } faPlayerHealth[playerid] = fHealth; } return 1; }