SA-MP Forums Archive
3D HUD - 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: 3D HUD (/showthread.php?tid=601516)



3D HUD - me1m - 22.02.2016

This Is Real?



Re: 3D HUD - lucamsx - 22.02.2016

I think its just an transparent object with text set on it.


Re: 3D HUD - me1m - 22.02.2016

I know. But how to update the text?


Re: 3D HUD - BroZeus - 22.02.2016

https://sampwiki.blast.hk/wiki/SetObjectMaterialText


Re: 3D HUD - me1m - 22.02.2016

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
The text will be blinking


Re: 3D HUD - me1m - 23.02.2016

The problem seems solved


Re: 3D HUD - me1m - 24.02.2016

If on a server two players, the samp crash
PHP код:
#include <a_samp> 
#include <YSF> 
#include <streamer> 
main(){} 
forward UpdateHealthEx(); 
new 
po_health[MAX_PLAYERS]; 
public 
OnGameModeInit() 

    
SetTimer("UpdateHealthEx"1000true); 
    return 
1

public 
OnPlayerConnect(playerid

    
po_health[playerid] = INVALID_OBJECT_ID
    return 
1

public 
OnPlayerSpawn(playerid

    
po_health[playerid] = CreateDynamicObject(19475, -100.0, -100.0, -100.00.00.00.0); 
    
SetPVarInt(playerid"spawned"1); 
    
GivePlayerWeapon(playeridWEAPON_M4250); 
    return 
1

public 
OnPlayerDeath(playeridkilleridreason

    
SetPVarInt(playerid"spawned"0); 
    if(
po_health[playerid] != INVALID_OBJECT_ID
    { 
        
DestroyDynamicObject(po_health[playerid]); 
        
po_health[playerid] = INVALID_OBJECT_ID
    } 
    return 
1

public 
OnPlayerDisconnect(playeridreason

    
SetPVarInt(playerid"spawned"0); 
    if(
po_health[playerid] != INVALID_OBJECT_ID
    { 
        
DestroyDynamicObject(po_health[playerid]); 
    } 
    return 
1

public 
UpdateHealthEx() 

    for(new 
0all = (GetMaxPlayers()+1); != allp++) 
    { 
        if(
IsPlayerConnected(p) && !IsPlayerNPC(p) && GetPVarInt(p"spawned") == 1UpdateHealth(p); 
    } 
    return 
false

stock UpdateHealth(const playerid

    new 
Floathealthstring[20]; 
    
GetPlayerHealth(playeridhealth); 
    
format(stringsizeof(string), "{ffffff}+%.0f"health); 
    
SetDynamicObjectMaterialText(po_health[playerid], 0string90"Arial"701, -1677696100); 
    
AttachDynamicObjectToPlayer(po_health[playerid], playerid, -0.4000, -0.6, -0.50.00000, -90.00000180.00000); 
    return 
0




Re: 3D HUD - me1m - 24.02.2016

Help please