Speedo Always dessaper
#1

Hey , Sry to bother you guys,But I really need those command , I need to fix that command wont gone after second , Also to fix that if you see any bugs , Really sry to bother but I must that.
Код:
CMD:speedo(playerid, params[]) {
	if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
		SendClientMessageEx(playerid, COLOR_GREY, "You're not driving a vehicle.");
	}
	else if(!PlayerInfo[playerid][pSpeedo]) {
		SendClientMessageEx(playerid, COLOR_WHITE, "You have enabled your speedometer.");
		PlayerInfo[playerid][pSpeedo] = 1;

		if(!FindTimePoints[playerid] && arr_Engine{GetPlayerVehicleID(playerid)} != 0) {

			new
				szSpeed[42];

			format(szSpeed, sizeof(szSpeed),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~%.0f MPH", player_get_speed(playerid));
			GameTextForPlayer(playerid, szSpeed, 150000000000, 3);
		}
	}
	else {
		SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled your speedometer.");
		PlayerInfo[playerid][pSpeedo] = 0;
		if(!FindTimePoints[playerid] && arr_Engine{GetPlayerVehicleID(playerid)} != 0) GameTextForPlayer(playerid, " ", 1500, 3);
	}
	return 1;
}
Reply
#2

You should consider using features for the purposes they were meant for. GameText for temporary messages (announcements, etc) and TextDraw for anything that's to be permanently on screen.
Reply
#3

Ok, Would you give me a guide/tutorial how to?
Reply
#4

pawn Код:
new string[124];
format(string,sizeof(string),"Speed: %d MPH",player_get_speed(playerid));
TextDrawSetString(Textdrawname,string);
That's how id do it.

Create the textdraw OnGameModeInit with a loop.

pawn Код:
for(new i = 0; i <MAX_PLAYERS; i++)
{
Then show it where its needed.
pawn Код:
//onplayerstatechange part

//the textdraw setstring goes here

if(newstate == PLAYER_STATE_DRIVER)
{
//   create the string here.
    TextDrawSetString(TDName,string);
    TextDrawShowForPlayer(playerid,TextDrawName);
}
Hope you understood :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)