infobar error :(
#1

hi i want to ad dthe case 6 to the textdraw but its givingme errors

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, 2, 3, 4, 5, 6, 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;
}
errors
pawn Код:
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(156) : warning 217: loose indentation
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(322) : warning 217: loose indentation
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1775) : warning 204: symbol is assigned a value that is never used: "id"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1775 -- 1779) : error 014: invalid statement; not in switch
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1779) : warning 215: expression has no effect
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1779) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1779) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\gamemodes\TLG_v1.0.pwn(1779) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
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: 2 Guest(s)