sandglass OnPlayerUpdate - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sandglass OnPlayerUpdate (
/showthread.php?tid=413204)
sandglass OnPlayerUpdate -
cChaD - 04.02.2013
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:Health, playerid);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
CarID[playerid] = GetPlayerVehicleID(playerid);
CarLabel[playerid] = Create3DTextLabel("", -1, 0, 0, 1, 20.0, 0, 1);
Attach3DTextLabelToVehicle(CarLabel[playerid], CarID[playerid], 0, 0, 1);
UpdateLife(playerid);
}
else
{
Delete3DTextLabel(CarLabel[playerid]);
}
return 1;
}
public OnPlayerUpdate(playerid)
{
UpdateLife(playerid);
}
UpdateLife(playerid)
{
new Float:Health;
GetVehicleHealth(CarID[playerid], Health);
UpdateString(Health, playerid);
}
UpdateString(Float:Health, playerid)
{
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], -1, str);
}
Re: sandglass OnPlayerUpdate -
Kyle - 04.02.2013
The sandglass is a 0.3x feature. You cannot disable it server-side.
Re : sandglass OnPlayerUpdate -
cChaD - 04.02.2013
but the player is freeze...
Re: sandglass OnPlayerUpdate -
SKAzini - 04.02.2013
The sandglass will show up when the server has pressed ESC and is paused.
Re : sandglass OnPlayerUpdate -
cChaD - 04.02.2013
it only appears when I put in OnPlayerUpdate