infobar error :(
#2

pawn Код:
forward TextUpdate(playerid); //Functions used in SetTimer(Ex) must be public! Means you have to use "forward [FuncName]([params]);" or you will get a warning!
public TextUpdate(playerid) //  ^
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPVarInt(i, "CalledAssistance") == 1) SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(i));
    }
    switch(GetPlayerState(playerid))
    {
        case 1..8:
    {
        switch(GetPlayerTeam(playerid))
        {
            case 1: //Police
            {
                TextDrawSetString(TextDraw[playerid][Work], "~w~Press ~g~~k~~PED_LOOKBEHIND~ ~r~(On foot) ~w~or ~g~~k~~VEHICLE_FIREWEAPON~ ~r~(In vehicle) ~w~to ~r~arrest~w~/~y~fine~w~!"); //Sets the TextDraw content (string)
            }
            case 2: //Trucker
            {
                if(!GetPVarInt(playerid, "IsWorking?")) //Checks if the player isn't working and display a different text
                {
                    TextDrawSetString(TextDraw[playerid][Work], "~w~You are ~r~not ~w~working! Type ~g~/WORK ~w~to start earning ~r~score ~w~and ~r~cash!"); //Sets the TextDraw content (string)
                }
                else //If the player is working then...
                {
                    new str[200]; //Set a STRING variable
                    GetPVarString(playerid, "OnMission", str, sizeof(str)); //Gets the info of the player's current job and stores it in the string
                    format(str, sizeof(str), "~g~Currently delivering: ~w~%s", str); //Inserts a text in the start of the string
                    TextDrawSetString(TextDraw[playerid][Work], str); //Explained 2 TIMES already
                }
            }
            case 3:
            {
                for(new i; i < MAX_PLAYERS; i++)
                {
                    if(GetPVarInt(i, "CalledAssistance") != 0) SetPlayerMarkerForPlayer(playerid, i, 0xff0000ff);
                }
                switch(txcount)
                {
                    case 0..20:
                    {
                        txcount++;
                        TextDrawSetString(TextDraw[playerid][Work], "~r~ON FOOT KEYS: ~g~~k~~PED_LOOKBEHIND~ ~w~to repair a vehicle, ~g~~k~~SNEAK_ABOUT~ ~w~to refuel a vehicle!"); //Sets the TextDraw content (string)
                    }
                    case 21..39:
                    {
                        txcount++;
                        TextDrawSetString(TextDraw[playerid][Work], "~r~IN VEHICLE KEYS: ~g~~k~~VEHICLE_LOOKRIGHT~ ~w~or ~g~~k~~VEHICLE_LOOKLEFT~ ~w~to start towing a vehicle!"); //Sets the TextDraw content (string)
                    }
                    case 40:
                    {
                        txcount = 0;
                        TextDrawSetString(TextDraw[playerid][Work], "~r~IN VEHICLE KEYS: ~g~~k~~VEHICLE_LOOKRIGHT~ ~w~or ~g~~k~~VEHICLE_LOOKLEFT~ ~w~to start towing a vehicle!"); //Sets the TextDraw content (string)

                    }
                }
            }
            case 4: //Bus Driver
            {
                    //Add your code here
                    if(!GetPVarInt(playerid, "IsWorking?")) //Checks if the player isn't working and display a different text
                    {
                        TextDrawSetString(TextDraw[playerid][Work], "~w~You are ~g~not ~w~working! Type ~r~/onduty ~w~to start earning ~r~score ~w~and ~r~cash!"); //Sets the TextDraw content (string)
                    }
                    else //If the player is working then...
                    {
                        new str[200], id = GetPVarInt(playerid, "InLineEx");
                        format(str, sizeof(str), "~g~Currently in route: ~w~%d : %s", BusRoutes[id][LineID], BusRoutes[id][LineNAME]); //Inserts a text in the start of the string
                        TextDrawSetString(TextDraw[playerid][Work], str); //Explained 2 TIMES already
                    }
                }
                case 5: //Cabbie//
                {
                    //Add your code here
                    if(!GetPVarInt(playerid, "IsWorking?")) //Checks if the player isn't working and display a different text
                    {
                        TextDrawSetString(TextDraw[playerid][Work], "~w~You are ~r~not ~w~working! Type ~p~~h~/Duty ~w~to start earning ~r~cash!"); //Sets the TextDraw content (string)
                    }
                    else //If the player is working then...
                    {
                        new str[200], id = GetPVarInt(playerid, "DUTY OR NOT");
                        format(str, sizeof(str), "~p~~h~You are on duty look for a fare"); //Inserts a text in the start of the string
                        TextDrawSetString(TextDraw[playerid][Work], str); //Explained 2 TIMES already
                    }
                    case 6: //racer
                {
                    TextDrawSetString(TextDraw[playerid][Work], "~g~Look For Races Or Go To ~r~/Drag ~g~ To Earn Cash"); //Sets the TextDraw content (string)
                }
               
                }
            }
            TextDrawShowForPlayer(playerid, TextDraw[playerid][Work]); //Show the textdraw
        }
        case 0, 7, 9: //If the player is initializing, Dead/In class selection or spectating then...
        {
            TextDrawHideForPlayer(playerid, TextDraw[playerid][Work]); //...Don't show the TextDraw
        }
    }
    return 1;
}
Reply


Messages In This Thread
infobar error :( - by [LHT]Bally - 20.09.2011, 11:56
Re: infobar error :( - by aRoach - 20.09.2011, 12:03
Re: infobar error :( - by [LHT]Bally - 20.09.2011, 12:08
Re: infobar error :( - by [LHT]Bally - 20.09.2011, 12:12
Re: infobar error :( - by aRoach - 20.09.2011, 12:18
Re: infobar error :( - by [LHT]Bally - 20.09.2011, 12:22
Re: infobar error :( - by aRoach - 20.09.2011, 12:25
Re: infobar error :( - by [LHT]Bally - 20.09.2011, 12:27

Forum Jump:


Users browsing this thread: 1 Guest(s)