sandglass OnPlayerUpdate
#1

Hey,

i have created an filterscript for showing 3d Bar life car but, when i see a player i look sandglass a left the name..

it's the OnPlayerUpdate() ?

PHP код:
#define filterscripts
#include <a_samp>
new Text3D:CarLabel[MAX_VEHICLES];
new 
CarID[MAX_VEHICLES];
UpdateLife(playerid);
UpdateString(Float:Healthplayerid);
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        
CarID[playerid] = GetPlayerVehicleID(playerid);
        
CarLabel[playerid] = Create3DTextLabel("", -100120.001);
        
Attach3DTextLabelToVehicle(CarLabel[playerid], CarID[playerid], 001);
        
UpdateLife(playerid);
    }
    else
    {
        
Delete3DTextLabel(CarLabel[playerid]);
    }
    
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    
UpdateLife(playerid);
}
UpdateLife(playerid)
{
    new 
Float:Health;
    
GetVehicleHealth(CarID[playerid], Health);
    
    
UpdateString(Healthplayerid);
}
UpdateString(Float:Healthplayerid)
{
    new 
str[28];
    if(
Health == 1000)             format(str,sizeof(str),"{00ff00}__________");
    else if(
Health >= 900)      format(str,sizeof(str),"{66ff00}_________{ffffff}_");
    else if(
Health >= 800)         format(str,sizeof(str),"{7fff00}________{ffffff}__");
    else if(
Health >= 700)        format(str,sizeof(str),"{ccff00}_______{ffffff}___");
    else if(
Health >= 600)        format(str,sizeof(str),"{f7f21a}______{ffffff}____");
    else if(
Health >= 500)        format(str,sizeof(str),"{f4c430}_____{ffffff}_____");
    else if(
Health >= 400)        format(str,sizeof(str),"{e49b0f}____{ffffff}______");
    else if(
Health >= 300)        format(str,sizeof(str),"{e4650e}___{ffffff}_______");
    else if(
Health >= 250)        format(str,sizeof(str),"{ff2400}__{ffffff}________");
    else                         
format(str,sizeof(str),"{ff2400}Boom!");
    
    
Update3DTextLabelText(CarLabel[playerid], -1str);

Reply
#2

The sandglass is a 0.3x feature. You cannot disable it server-side.
Reply
#3

but the player is freeze...
Reply
#4

The sandglass will show up when the server has pressed ESC and is paused.
Reply
#5

it only appears when I put in OnPlayerUpdate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)