SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/09/2013, 11:28 PM   #1
Grooty
Big Clucker
 
Join Date: May 2013
Posts: 135
Reputation: -6
Default How do I create an engine system and a total system?

I want to make a /engine system for my script, as well as a total system.
How?
__________________
Grooty is offline   Reply With Quote
Old 09/09/2013, 11:39 PM   #2
Tom1412
Huge Clucker
 
Join Date: Sep 2010
Posts: 427
Reputation: 31
Default Re: How do I create an engine system and a total system?

Goto www.******.co.uk

search samp engine system

There you go use the ****** to search befor posting or the search button on forum
Tom1412 is offline   Reply With Quote
Old 09/09/2013, 11:43 PM   #3
Omar55555
Huge Clucker
 
Omar55555's Avatar
 
Join Date: Jun 2013
Location: Area 69
Posts: 228
Reputation: 17
Default Re: How do I create an engine system and a total system?

and u should say extra informations like what kind of command inculde u using (strcmd-zcmd-ycmd-etcc.)

and search on ****** sure u will find something usefull like a good format etc..
Omar55555 is offline   Reply With Quote
Old 09/09/2013, 11:46 PM   #4
Eyce
Big Clucker
 
Eyce's Avatar
 
Join Date: Sep 2013
Posts: 154
Reputation: 21
Default Re: How do I create an engine system and a total system?

There are a lot of vehicle engine systems, all you need to do is to search. Here's a simple one I made using ZCMD for the engine command.
pawn Code:
#define     VEHICLE_PARAMS_OFF      0
#define     VEHICLE_PARAMS_ON       1

new VehicleEngine[MAX_VEHICLES];

public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        new vehicle = GetPlayerVehicleID(playerid);
        new Float:vehicleHP;
        GetVehicleHealth(vehicle, vehicleHP);
       
        if(vehicleHP <= 350) // set this to whatever you like
        {
            SetVehicleHealth(vehicle, 400);
            TogglePlayerControllable(playerid, false); // optional
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicle, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
            GameTextForPlayer(playerid, "~r~TOTALLED!", 1000, 5);
            VehicleEngine[vehicle] = VEHICLE_PARAMS_OFF;
        }
    }
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    VehicleEngine[vehicleid] = VEHICLE_PARAMS_OFF;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
    return 1;
}

CMD:engine(playerid, params[])
{
    #pragma unused params
    new engine, lights, alarm, doors, bonnet, boot, objective;
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicle = GetPlayerVehicleID(playerid);
        if(VehicleEngine[vehicle] == VEHICLE_PARAMS_OFF)
        {
            VehicleEngine[vehicle] = VEHICLE_PARAMS_ON;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, -1, "Engine: ON");
        }
        else
        {
            VehicleEngine[vehicle] = VEHICLE_PARAMS_OFF;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, -1, "Engine: OFF);
        }
    }
    else SendClientMessage(playerid, -1, "
You're not in the driver's seat.");
    return 1;
}
Haven't tested it though.
Eyce is offline   Reply With Quote
Old 09/09/2013, 11:54 PM   #5
Grooty
Big Clucker
 
Join Date: May 2013
Posts: 135
Reputation: -6
Default Re: How do I create an engine system and a total system?

Quote:
Originally Posted by Eyce View Post
There are a lot of vehicle engine systems, all you need to do is to search. Here's a simple one I made using ZCMD for the engine command.
pawn Code:
#define     VEHICLE_PARAMS_OFF      0
#define     VEHICLE_PARAMS_ON       1

new VehicleEngine[MAX_VEHICLES];

public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        new vehicle = GetPlayerVehicleID(playerid);
        new Float:vehicleHP;
        GetVehicleHealth(vehicle, vehicleHP);
       
        if(vehicleHP <= 350) // set this to whatever you like
        {
            SetVehicleHealth(vehicle, 400);
            TogglePlayerControllable(playerid, false); // optional
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicle, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
            GameTextForPlayer(playerid, "~r~TOTALLED!", 1000, 5);
            VehicleEngine[vehicle] = VEHICLE_PARAMS_OFF;
        }
    }
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    VehicleEngine[vehicleid] = VEHICLE_PARAMS_OFF;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
    return 1;
}

CMD:engine(playerid, params[])
{
    #pragma unused params
    new engine, lights, alarm, doors, bonnet, boot, objective;
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicle = GetPlayerVehicleID(playerid);
        if(VehicleEngine[vehicle] == VEHICLE_PARAMS_OFF)
        {
            VehicleEngine[vehicle] = VEHICLE_PARAMS_ON;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, -1, "Engine: ON");
        }
        else
        {
            VehicleEngine[vehicle] = VEHICLE_PARAMS_OFF;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, -1, "Engine: OFF);
        }
    }
    else SendClientMessage(playerid, -1, "
You're not in the driver's seat.");
    return 1;
}
Haven't tested it though.
Doesn't really work, but thanks
__________________
Grooty is offline   Reply With Quote
Old 10/09/2013, 09:34 AM   #6
Ceez
Big Clucker
 
Join Date: Oct 2012
Posts: 78
Reputation: 22
Default Re: How do I create an engine system and a total system?

Use
pawn Code:
SetVehicleParams
to toggle the engine/doors/lights/alarm status and those.
Check out http://wiki.sa-mp.com/wiki/SetVehicleParamsEx for more information.
Ceez is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Engine System John_Cooper Scripting Help 0 15/09/2012 09:09 PM
Engine system PaulDinam Scripting Help 4 26/06/2012 07:08 PM
Engine System. Nicholas. Scripting Help 8 23/03/2012 09:20 PM
/pm System/ Engine Bam23 Help Archive 13 27/03/2011 02:58 PM
[HELP]I just edited my /engine system and when i do /engine it says "unknown Lilcuete Help Archive 2 25/04/2010 01:31 PM


All times are GMT. The time now is 04:55 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.