Nooby Questions??
#1

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.
Reply
#2

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
Reply
#3

Ah Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)