a problem help^
#1

i have a problem with fuel and speedometter, i can see the speedo and fuel for everyone when i /tog speedo or /tog fuel

codes for speedo
pawn Код:
// Speedometer
        if(Speedo[playerid] && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new string[64], speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
            //format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Speedometer: ~w~%d MPH", speed);
            format(string,sizeof(string),"MPH: %d", speed);
            TextDrawSetString(speedometer, string);
            //GameTextForPlayer(playerid, string,1000, 3);
        }
pawn Код:
// Speedometer
    speedometer = TextDrawCreate(292.000000, 432.000000, "MPH:");
    TextDrawBackgroundColor(speedometer, 255);
    TextDrawFont(speedometer, 1);
    TextDrawLetterSize(speedometer, 0.500000, 1.000000);
    TextDrawColor(speedometer, 16777215);
    TextDrawSetOutline(speedometer, 0);
    TextDrawSetProportional(speedometer, 1);
    TextDrawSetShadow(speedometer, 1);
    TextDrawSetSelectable(speedometer, 0);
Reply
#2

You can see both speedo and fuel, then what is the problem?
Reply
#3

no i don't mean this, i mean when i tog speed i see the speedo for everyone is using, same story with fuel.
Reply
#4

You mean, if you write a command "/tog speed" then you will get an output of who's using Speedometer currently or what?

edit:// @down,
I don't know if you got this right, but if you did, then you're master of decrypting nasty English.
Reply
#5

There is only ONE variable, so once you update it, it will show to everyone who can see this ONE textdraw. You need to turn your "speedometer" variable into a MAX_PLAYER array and create the textdraw for each player individually. I recommend using PlayerTextDraw.
Reply
#6

well well.
these are the types of textdraws that need to be assigned to the clients individually
for the textdraw-id it should look similar to:
pawn Код:
new Text:speedo[MAX_PLAYERS][NUMBER_OF_TEXTDRAWS];//dont need the last dimension if its just 1
i also strongly recommand you to use PlayerTextdraws
so it'd look like
pawn Код:
new PlayerText:speedo[MAX_PLAYERS][NUMBER_OF_TEXTDRAWS];
edit:
Quote:
Originally Posted by Riddick94
Посмотреть сообщение
I am pretty sure, that Player TextDraws don't need to be an array anymore (unless you want to specify more than one textdraw for that category, not needed to create for each player anymore).
dang it! correct, i was still thiking of normal textdraws
Reply
#7

Quote:
Originally Posted by CutX
Посмотреть сообщение
well well.
these are the types of textdraws that need to be assigned to the clients individually
for the textdraw-id it should look similar to:
pawn Код:
new Text:speedo[MAX_PLAYERS][NUMBER_OF_TEXTDRAWS];//dont need the last timension if its just 1
i also strongly recommand you to use PlayerTextdraws
so it'd look like
pawn Код:
new PlayerText:speedo[MAX_PLAYERS][NUMBER_OF_TEXTDRAWS];
I am pretty sure, that Player TextDraws don't need to be an array anymore (unless you want to specify more than one textdraw for that category, not needed to create for each player anymore).
Reply
#8

just give me full code :c
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)