3D HUD
#1

This Is Real?
Reply
#2

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

I know. But how to update the text?
Reply
#4

https://sampwiki.blast.hk/wiki/SetObjectMaterialText
Reply
#5

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

The problem seems solved
Reply
#7

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

Reply
#8

Help please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)