car/bike fix? - 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: car/bike fix? (
/showthread.php?tid=91920)
car/bike fix? -
Eazy_E214 - 17.08.2009
hi
i need a filterscript witch fix cars/bikes.. automatic
Re: car/bike fix? -
Doppeyy - 17.08.2009
forward Fixcar;
SetTimer("Fixcar",1000,false);
Public Fixcar(playerid)
{
SetCarHealth(100);
}
this is just straight out of my head so i post any errors here.
/Artix
Re: car/bike fix? -
Eazy_E214 - 17.08.2009
Quote:
Originally Posted by [RiFA
Artix ]
forward Fixcar;
SetTimer("Fixcar",1000,false);
Public Fixcar(playerid)
{
SetCarHealth(100);
}
this is just straight out of my head so i post any errors here.
/Artix
dont work pls make a FS
|
Re: car/bike fix? -
snoob - 17.08.2009
pawn Код:
#include <a_samp>
forward FixAllCar();
new FixTimer;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
FixTimer = SetTimer("FixAllCar",1000,true);//every 1000 milisecond we call the function "FixAllCar"
return 1;
}
public OnFilterScriptExit()
{
KillTimer(FixTimer); // we kill our timer on script unload.
return 1;
}
public FixAllCar()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
// loop all possible player
{
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
//if the player is connected AND in a car
{
new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
SetVehicleHealth(vehicleid,1000.0);// set the vehicle healt
}
}
}
i hope you know how to compile a script ...
EDIT: if not here is a link for a fully compiled amx ...
http://www.studio2015.ca/fixallcar.amx
Re: car/bike fix? -
Eazy_E214 - 18.08.2009
Quote:
Originally Posted by snoob
pawn Код:
#include <a_samp> forward FixAllCar(); new FixTimer;
public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); FixTimer = SetTimer("FixAllCar",1000,true);//every 1000 milisecond we call the function "FixAllCar" return 1; }
public OnFilterScriptExit() { KillTimer(FixTimer); // we kill our timer on script unload. return 1; }
public FixAllCar() { for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) // loop all possible player { if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid)) //if the player is connected AND in a car { new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id SetVehicleHealth(vehicleid,1000.0);// set the vehicle healt } } }
i hope you know how to compile a script ...
EDIT: if not here is a link for a fully compiled amx ...
http://www.studio2015.ca/fixallcar.amx
|
thanks