"From gametext to textdraw" problem.
#1

Hi all,

I was making a panel for my gamemode. Everything went well ti'll i begun with the gass part. It is in gametext, but i tried to make it into textdraw. In one moment i thought that i figured it out, but no luck. When i went to try out if i fixed it, the gass would just be still, when i was driving a car. It wouldn't change the numbers at all. If i would want to see the correct numbers, i would need to get out of the car and go back to it. Then the numbers would change, but still it freezes and no reaction. There were no errors and no warnings in the script when i edited it. Here's the script:

Код:
new msg[256];

if(entered) 
{
    format(msg,255,"~n~~n~~n~~n~                                 %s ~n~~r~                                 Fuel:~w~ %i L",aVehicleNames[GetVehicleModel(vehicleid)-400],vehicleDB[vehicleid][gas]);
}else{
    format(msg,255,"~n~~n~~n~~n~~n~~r~                                 Fuel:~w~ %i L",vehicleDB[vehicleid][gas]);
}
GameTextForPlayer(playerid,msg,3000,5);

}
Everything was fine, but the gass part won't fix even if i bump my head to the wall.

Thanks in advance for any help.


Screenshot:
Reply
#2

You havn't shown us the timer you use to update the fuel. Do that.
Reply
#3

Try

GameTextForPlayer(playerid,msg,3000,3);
Reply
#4

Quote:
Originally Posted by CrucixTM
Посмотреть сообщение
You havn't shown us the timer you use to update the fuel. Do that.
Well isn't the "GameTextForPlayer" like kind of a timer ?


Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
Try

GameTextForPlayer(playerid,msg,3000,3);
You don't get my point. I want this script to be done in Textdraw, not in gametext. But i don't know how to do that.
Reply
#5

here's how to create a textdraw...
https://sampwiki.blast.hk/wiki/TextDrawCreate

use the code given there and as text you just write: msg
without any ' " ' or so... and then do:
TextDrawShowForPlayer(playerid, theshortcurofthetextyoumade);
Reply
#6

Код:
stock OutputGas(playerid,vehicleid,bool:entered){

new Text:Kuras;
new msg[256];

if(entered) 
{
	format(msg,255," %s Degalai:~w~ %i l",aVehicleNames[GetVehicleModel(vehicleid)-400],vehicleDB[vehicleid][gas]);
}else{
	format(msg,255,"Degalai:~w~ %i l",vehicleDB[vehicleid][gas]);
}
TextDrawSetString(Kuras, msg);

Kuras = TextDrawCreate(515.000000, 432.000000, "msg");
TextDrawBackgroundColor(Kuras, 255);
TextDrawFont(Kuras, 1);
TextDrawLetterSize(Kuras, 0.370000, 1.300000);
TextDrawColor(Kuras, -1);
TextDrawSetOutline(Kuras, 1);
TextDrawSetProportional(Kuras, 1);
TextDrawShowForPlayer(Kuras, playerid, msg); //360 line

SetTimer("OutputGas", 1000,true);

}
And i get:

Код:
data/functions.txt(360) : warning 213: tag mismatch
data/functions.txt(360) : warning 213: tag mismatch
data/functions.txt(360) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
I believe that this got to do something with the

Код:
stock OutputGas(playerid,vehicleid,bool:entered){
Maybe i don't need these:

Код:
vehicleid,bool:entered
?

EDIT: The gas still won't show up. And when i delete those, it gets worse.
Reply
#7

Smart one, GameTextForPlayer/All = Textdraws, good job.
Reply
#8

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
Smart one, GameTextForPlayer/All = Textdraws, good job.
No, it's still not working. And i can't figure it out whats wrong.
Reply
#9

Change

pawn Код:
TextDrawShowForPlayer(Kuras, playerid, msg); //360 line
To

pawn Код:
TextDrawShowForPlayer(Kuras, playerid); //The msg string isn't needed in Showing the textdraw.
Reply
#10

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
Change

pawn Код:
TextDrawShowForPlayer(Kuras, playerid, msg); //360 line
To

pawn Код:
TextDrawShowForPlayer(Kuras, playerid); //The msg string isn't needed in Showing the textdraw.
This fixed 1 warning, but the other two are really annoying. If i remove the vehicleid and the bool:entered it makes more warnings and some errors.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)