[Problem]3dlabelText
#1

Hello, i have a small problem that i cant fix..
PHP код:
    if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
    {
         
Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_BRIGHTRED"lala");
    }
    
    if((
oldstate == PLAYER_STATE_PASSENGER && newstate == PLAYER_STATE_ONFOOT) || (oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT))
    {
        if(
VehicleInfo[car][Buyable] == && !strcmp(VehicleInfo[car][CarOwner], "none"true))
        {
            
Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_BRIGHTRED"Public");
           }
        else if(
VehicleInfo[car][Buyable] == && strcmp(VehicleInfo[car][CarOwner], "none"true))
        {
            
Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_ORANGEVehicleInfo[car][CarOwner]);
        }
        else
        {
            
Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_LIGHTGREEN"Buy");
           }
    } 
When I enter the vehicle the label changes to lala but when I exit the vehicle, the label doesn't changes back..
Reply
#2

bump
Reply
#3

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    //Obviously your variables for 'car' etc. will be here, as well as previous State Changes.
    if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
    {
         Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_BRIGHTRED, "lala");
    }
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
        {
            if(VehicleInfo[car][Buyable] == 0)
            {
                if(strcmp(VehicleInfo[car][CarOwner], "none", true) == 0)
                {
                    Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_BRIGHTRED, "Public");
                }
                else if(strcmp(VehicleInfo[car][CarOwner], "none", true))
                {
                    Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_ORANGE, VehicleInfo[car][CarOwner]);
                }
            }
            else
            {
                Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_LIGHTGREEN, "Buy");
            }
        }  
    }
    return 1;
}
NOTE: Untested
Reply
#4

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    //Obviously your variables for 'car' etc. will be here, as well as previous State Changes.
    if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
    {
         Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_BRIGHTRED, "lala");
    }
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
        {
            if(VehicleInfo[car][Buyable] == 0)
            {
                if(strcmp(VehicleInfo[car][CarOwner], "none", true) == 0)
                {
                    Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_BRIGHTRED, "Public");
                }
                else if(strcmp(VehicleInfo[car][CarOwner], "none", true))
                {
                    Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_ORANGE, VehicleInfo[car][CarOwner]);
                }
            }
            else
            {
                Update3DTextLabelText(VehicleInfo[car][labelID], COLOR_LIGHTGREEN, "Buy");
            }
        }  
    }
    return 1;
}
NOTE: Untested
Thanks, I will check it soon and I will update the thread.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)