Speedo Always dessaper - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Speedo Always dessaper (
/showthread.php?tid=448207)
Speedo Always dessaper -
ProjectFutureRolePlay - 03.07.2013
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;
}
Re: Speedo Always dessaper -
Vince - 03.07.2013
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.
Re: Speedo Always dessaper -
ProjectFutureRolePlay - 03.07.2013
Ok, Would you give me a guide/tutorial how to?
Re: Speedo Always dessaper -
DobbysGamertag - 03.07.2013
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