3D HUD
#16

При подключении второго игрока краш сампа
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] = INVALID_OBJECT_ID;
    if(
po_health[playerid] == INVALID_OBJECT_ID)
        
po_health[playerid] = CreateDynamicObject(19475, -100.0, -100.0, -100.00.00.00.0);
    
SetPVarInt(playerid"spawned"1);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
SetPVarInt(playerid"spawned"0);
    if(
po_health[playerid] != INVALID_OBJECT_ID)
        
DestroyDynamicObject(po_health[playerid]);
    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, 05:59
Re: 3D HUD - by Stuntff - 22.02.2016, 06:06
Re: 3D HUD - by me1m - 22.02.2016, 06:24
Re: 3D HUD - by Romz - 22.02.2016, 10:48
Re: 3D HUD - by me1m - 22.02.2016, 10:50
Re: 3D HUD - by Mcc - 22.02.2016, 11:45
Re: 3D HUD - by me1m - 22.02.2016, 11:50
Re: 3D HUD - by Mcc - 22.02.2016, 12:33
Re: 3D HUD - by me1m - 22.02.2016, 12:44
Re: 3D HUD - by Mcc - 22.02.2016, 13:30
Re: 3D HUD - by me1m - 22.02.2016, 13:44
Re: 3D HUD - by Mcc - 22.02.2016, 13:56
Re: 3D HUD - by me1m - 22.02.2016, 14:01
Re: 3D HUD - by Mcc - 22.02.2016, 19:23
Re: 3D HUD - by Romz - 22.02.2016, 19:57
Re: 3D HUD - by me1m - 23.02.2016, 11:25
Re: 3D HUD - by me1m - 23.02.2016, 19:10
Re: 3D HUD - by stabker - 23.02.2016, 19:35
Re: 3D HUD - by me1m - 23.02.2016, 20:11
Re: 3D HUD - by me1m - 24.02.2016, 12:16
Re: 3D HUD - by [Saint] - 24.02.2016, 21:16
Re: 3D HUD - by me1m - 24.02.2016, 21:27
Re: 3D HUD - by OKStyle - 25.02.2016, 17:38
Re: 3D HUD - by me1m - 27.02.2016, 02:38
Re: 3D HUD - by Mcc - 27.02.2016, 05:31
Re: 3D HUD - by me1m - 29.02.2016, 22:25
Re: 3D HUD - by me1m - 04.03.2016, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)