health bar
#5

By the way, should you set some variable on the server side to store the health of each player, and avoid the cheaters?

Something like this:

PHP код:
//OnPlayerConnect
Player_Info[playerid][player_Health] = 100.0;
SetPlayerHealth(playeridPlayer_Info[playerid][player_Health]);
//OnPlayerTakeDamage
Player_Info[playerid][player_Health] -= amount;
if(
Player_Info[playerid][player_Health] <= 0.0)
{
SetPlayerHealth(playerid0.0);
}
//Command /kill
CMD:kill(playeridparams[])
{
        
Player_Info[playerid][player_Health] = 0.0;
    
SetPlayerHealth(playeridPlayer_Info[playerid][player_Health]);
    return 
1;
}
//Command /health
CMD:health(playeridparams[])
{
    if(
sscanf(params"df"params[0], params[1])) return SendClientMessage(playerid,-1"/health <playerid> <health>");
    
Player_Info[params[0]][player_Health] = params[1];
    
SetPlayerHealth(params[0], params[1]);
    return 
1;

Reply


Messages In This Thread
health bar - by Volumen - 17.02.2019, 18:42
Re: health bar - by Kasichok - 17.02.2019, 19:02
Re: health bar - by Volumen - 17.02.2019, 20:09
Re: health bar - by HNIC - 17.02.2019, 20:17
Re: health bar - by Volumen - 17.02.2019, 21:49

Forum Jump:


Users browsing this thread: 1 Guest(s)