umm,an problem with speedo - 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: umm,an problem with speedo (
/showthread.php?tid=152724)
umm,an problem with speedo -
WardenCS - 05.06.2010
Hey,i have problem with speedo,if i go to /carshop,i want it to disable the speedo,but it wont,i dont know how to disable it,i tried it but i couldnt,heres the code,thanks
Код:
forward Speedometer();
public Speedometer()
{
new Float:maxspeed = 175.0;
new plname[MAX_PLAYER_NAME];
new string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
CarShopping[i] = true;
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == 2)
{
GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
if(TelePos[i][5] > 550.0)
{
TelePos[i][0] = 0.0;
TelePos[i][1] = 0.0;
}
if(TelePos[i][0] != 0.0)
{
new Float:xdist = TelePos[i][3]-TelePos[i][0];
new Float:ydist = TelePos[i][4]-TelePos[i][1];
new Float:sqxdist = xdist*xdist;
new Float:sqydist = ydist*ydist;
new Float:distance = (sqxdist+sqydist)/31;
if(gSpeedo[i] == 2)
{
new vehicle = GetPlayerVehicleID(i);
new model = GetVehicleModel(vehicle);
if(model == 481 || model == 509 || model == 510)
{
return 0;
}
if(distance <10)
{
format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~>~~r~mph : ~w~%.0f ~r~ Fuel: ~w~ %d~<~",distance, Fuel[vehicle]);
}
if(distance > 10 && distance < 100)
{
format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~>~~r~mph : ~w~%.0f ~r~ Fuel: ~w~ %d~<~",distance, Fuel[vehicle]);
}
if(distance > 100)
{
format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~>~~r~mph : ~w~%.0f ~r~ Fuel: ~w~ %d~<~",distance, Fuel[vehicle]);
}
GameTextForPlayer(i, string, 2000, 5);
}
if(distance > maxspeed)
{
GetPlayerName(i, plname, sizeof(plname));
format(string, 256, "NC-RP Anticheat - %s[%d] speed is - %.0f mph",plname, i ,distance);
Adminmsg(string);
}
}
if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
{
TelePos[i][0] = TelePos[i][3];
TelePos[i][1] = TelePos[i][4];
}
}
}
}
return 1;
}
Re: umm,an problem with speedo -
WardenCS - 05.06.2010
bump?
Re: umm,an problem with speedo -
DJDhan - 05.06.2010
It won't hide? You don't haven't created any "on" and "off" option :P Btw, when do you call the function Speedometer?
Re: umm,an problem with speedo -
WardenCS - 05.06.2010
its with timer,every 1000 milliseconds or smth
Re: umm,an problem with speedo -
WardenCS - 06.06.2010
BUMPz!