Nooby Questions?? - 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: Nooby Questions?? (
/showthread.php?tid=367440)
Nooby Questions?? -
BigAl - 10.08.2012
Hey just wondering:
how can i make it so that you have to be in a certain area to perform this command....
how can i make an engine stop when the fuel of a vehicle has ran out... and start again when you refuel it.
Re: Nooby Questions?? -
FalconX - 10.08.2012
Quote:
Originally Posted by BigAl
Hey just wondering:
how can i make it so that you have to be in a certain area to perform this command....
how can i make an engine stop when the fuel of a vehicle has ran out... and start again when you refuel it.
|
For the first question you can do something like:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
pawn Код:
CMD:example( playerid, params[ ] )
{
if( IsPlayerInRangeOfPoint( playerid, Float:range, Float:X, Float:Y, Float:Z ) )
{
// he is in certain area - your code:-
}
else
{
SendClientMessage( playerid, -1, "Error: You are not near the PLACE_NAME" );
}
return 1;
}
For second question you can just get the vehicle params and set the way you want like this:
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
pawn Код:
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective); // you can set 1 or 0 for engine
Re: Nooby Questions?? -
BigAl - 10.08.2012
Ah Thanks