texdraw in-car - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: texdraw in-car (
/showthread.php?tid=164775)
texdraw in-car -
Carrera - 01.08.2010
Hy how i can make to show my some TXT Draw only in CAR?
Re: texdraw in-car -
Steven82 - 01.08.2010
Код:
If(IsPlayerInAnyVehicle)
{
ShowPlayerTextdraw
}
Should work, but use the proper ShowPlayerTextdraw function......
Re: texdraw in-car -
Carrera - 01.08.2010
PHP код:
C:\Users\Deniel\Desktop\GM\filterscripts\Bezinomer.pwn(28) : error 017: undefined symbol "If"
C:\Users\Deniel\Desktop\GM\filterscripts\Bezinomer.pwn(30) : error 017: undefined symbol "ShowPlayerTextdraw"
C:\Users\Deniel\Desktop\GM\filterscripts\Bezinomer.pwn(32) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
?-?-?
Re: texdraw in-car -
WillyP - 01.08.2010
Re: texdraw in-car -
Kar - 01.08.2010
LOL
pawn Код:
if(IsPlayerInAnyVehicle)
{
TextDrawShowForPlayer(playerid,Text:);
}
Re: texdraw in-car -
MrDeath537 - 01.08.2010
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
{
TextDrawShowForPlayer(playerid, textdraw);
}
Re: texdraw in-car -
Toni - 01.08.2010
You guys aren't telling him the right thing.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
TextDrawShowForPlayer(playerid, textdraw);
return 1;
}
Re: texdraw in-car -
Nonameman - 01.08.2010
Quote:
Originally Posted by Carrera
Hy how i can make to show my some TXT Draw only in CAR?
|
Emm, try this:
pawn Код:
new Text:MyTextDraw;
OnGameModeInit()
{
MyTextDraw = TextDrawCreate(x, y, "TextDraw String");
return 1;
}
stock IsInCar(playerid)
{
new NotCarModels[] = {548,469,447,563,497,488,487,417,425};//find the models in the Useful Snippets
for(new c=0; c<sizeof(NotCarModels); c++)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == NotCarModels[c]) return false;
}
return true;
}
OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if(IsInCar(playerid)) TextDrawShowForPlayer(playerid, MyTextDraw);
}
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
{
TextDrawHideForPlayer(playerid, MyTextDraw);
}
return 1;
}
Re: texdraw in-car -
Carrera - 01.08.2010
pawn Код:
C:\Users\Deniel\Desktop\GM\filterscripts\espeed+.pwn(59) : warning 203: symbol is never used: "OnGameModeInit"
C:\Users\Deniel\Desktop\GM\filterscripts\espeed+.pwn(59) : warning 203: symbol is never used: "OnPlayerStateChange"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
.
Whit
pawn Код:
#include <a_samp>
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw3;
OnGameModeInit()
{
Textdraw0 = TextDrawCreate(490.000000, 317.000000, "Brzina:");
TextDrawBackgroundColor(Textdraw0, -16711681);
TextDrawFont(Textdraw0, 0);
TextDrawLetterSize(Textdraw0, 0.689998, 3.799998);
TextDrawColor(Textdraw0, 255);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Textdraw1 = TextDrawCreate(649.000000, 320.000000, "_");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 0);
TextDrawLetterSize(Textdraw1, 0.689998, 3.799998);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
TextDrawUseBox(Textdraw1, 1);
TextDrawBoxColor(Textdraw1, 255);
TextDrawTextSize(Textdraw1, 475.000000, 10.000000);
Textdraw3 = TextDrawCreate(602.000000, 340.000000, "KM/h");
TextDrawBackgroundColor(Textdraw3, -1);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.319999, 1.499999);
TextDrawColor(Textdraw3, 255);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
return 1;
}
stock IsInCar(playerid)
{
new NotCarModels[] = {548,469,447,563,497,488,487,417,425};//find the models in the Useful Snippets
for(new c=0; c<sizeof(NotCarModels); c++)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == NotCarModels[c]) return false;
}
return true;
}
OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if(IsInCar(playerid)) TextDrawShowForPlayer(playerid, Textdraw3, Textdraw1 ,Textdraw0);
}
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
{
TextDrawHideForPlayer(playerid, MyTextDraw);
}
return 1;
}
Re: texdraw in-car -
Steven82 - 01.08.2010
OMG, i had it right, i told him to use the real textdraw code, and i forgot to delete the Capital "I" and this is just easy and common sense....