3D HUD
#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


Messages In This Thread
3D HUD - by me1m - 22.02.2016, 10:15
Re: 3D HUD - by lucamsx - 22.02.2016, 11:19
Re: 3D HUD - by me1m - 22.02.2016, 11:25
Re: 3D HUD - by BroZeus - 22.02.2016, 11:53
Re: 3D HUD - by me1m - 22.02.2016, 11:56
Re: 3D HUD - by me1m - 23.02.2016, 19:23
Re: 3D HUD - by me1m - 24.02.2016, 13:04
Re: 3D HUD - by me1m - 24.02.2016, 17:46

Forum Jump:


Users browsing this thread: 1 Guest(s)