Names with 3DTextLabels
#4

Try this code, if it's not working print some of the strings, you're setting the 3DTextLabel to and see if it set's the string value correctly, if not find out what causes it not to set the string "correct". Also you can use this define I added to the start of the code to remove all the forwards and make hopefully make your scripting a little bit more comfortable. PS, next time use [ PAWN ] [ / PAWN ] tags instead of code, makes it a little more easier to read

pawn Код:
#define publicEx%0(%1) forward%0(%1); public%0(%1)
publicEx DrugTime()
{

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerAccount[i][Logged])
        {
            new Float:health, namedstring[60];
            GetPlayerHealth(i, health);
            format(namedstring, sizeof(namedstring), "%s", PlayerAccount[i][Name]);
           
            if(PlayerAccount[i][wearingmask] == 1){
                    format(namedstring, sizeof(namedstring), "Sconosciuto #%d", PlayerAccount[i][ID]);
                    UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xDCEAE9FF, namedstring);
            }

            if (health >= 65.0 && Drinking[i]==0)
            {
                SetPlayerDrunkLevel(i, 0);
                if(PlayerAccount[i][wearingmask] == 1){

                    format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]);
                    UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xDCEAE9FF, namedstring);
                }
            }
            else if (health <= 65.0 && health > 45 && Antidolor[i]==0)
            {
                if(PlayerAccount[i][wearingmask] == 1){

                    format(namedstring, sizeof(namedstring), "Sconosciuto #%d", PlayerAccount[i][ID]);
                    UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xFFDC00FF, namedstring);
                }
            }
            else if (health <= 45.0 && health > 30 && Antidolor[i] == 0)
            {
                if(random(1)==0){
                    if(!IsPlayerInAnyVehicle(i))
                    {
                        ApplyAnimation(i,"SWEET","Sweet_injuredloop",4.0,1,0,0,0,6000,1); //anim injured
                    }
                    if(PlayerAccount[i][wearingmask] == 1)
                    {
                        format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]);
                        UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xFF5000FF, namedstring);
                    }
                    SetPlayerHealth(i, health-1);
                    PlayerActionMessage(i,15.0,"non sta bene.");
                    SetPlayerDrunkLevel(i, 5000);
                }
            }
            else if (health <= 30.0 && Antidolor[i] == 0)
            {
                if(random(1)==0){
                    if(!IsPlayerInAnyVehicle(i))
                    {
                        ApplyAnimation(i,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
                    }
                    if(PlayerAccount[i][wearingmask] == 1){

                        format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]);
                        UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xFF1400FF, namedstring);
                    }
                    SetPlayerHealth(i, health-2.5);
                    PlayerActionMessage(i,15.0,"non sta bene.");
                    SetPlayerDrunkLevel(i, 10000);
                }
            }
            if(ADuty[i])
            {
                format(namedstring, sizeof(namedstring), "Admin %s", PlayerAccount[i][Name]);
                UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0x5189F0FF, namedstring);
            }
            else if(HelperDuty[i])
            {
                format(namedstring, sizeof(namedstring), "Helper %s", PlayerAccount[i][Name]);
                UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0x91FFADFF, namedstring);
            }
         }
    }
}
Reply


Messages In This Thread
Names with 3DTextLabels - by Scienziatopazzo - 25.06.2012, 17:46
Re: Names with 3DTextLabels - by Scienziatopazzo - 27.06.2012, 12:15
Re: Names with 3DTextLabels - by Scienziatopazzo - 28.06.2012, 16:51
Re: Names with 3DTextLabels - by HP - 28.06.2012, 17:17

Forum Jump:


Users browsing this thread: 1 Guest(s)