Welcome to our official forums, we provide weekly streaming of premium WWE content, and have a Marketplace for general Accounts/Keys/Items.


You are not connected. Please login or register

Simple Engine System

Go down  Message [Page 1 of 1]

1 Simple Engine System on Thu Nov 01, 2012 2:24 am

Redbull

avatar
Admin
Engine system, for beginner scripters/gamemode developers



Code:
CMD:engine(playerid, params[])
{
        new vehicleid = GetPlayerVehicleID(playerid);
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command");
        if(vehEngine[vehicleid] == 0)
        {
            vehEngine[vehicleid] = 2;
            SetTimerEx("StartEngine", 3000, 0, "i", playerid);
            SendClientMessage(playerid, COLOR_GREEN, "Vehicle engine starting");
        }
        else if(vehEngine[vehicleid] == 1)
        {
            vehEngine[vehicleid] = 0;
            TogglePlayerControllable(playerid, 0);
            SendClientMessage(playerid, COLOR_GOLD, "Vehicle engine stopped");
            SendClientMessage(playerid, COLOR_GOLD, "To re-start the vehicle's engine press \"Shift\" or type \"/engine\"");
        }
        return 1;
}

http://eazygaming.forumotion.com

2 Re: Simple Engine System on Sat Oct 19, 2013 3:13 pm

Mickey227


Thx man ! Smile Like it ! Very Happy

3 Re: Simple Engine System on Sun Oct 20, 2013 4:39 pm

Anon123


Simple but nice, thanks!

4 Re: Simple Engine System on Sun Oct 20, 2013 4:40 pm

Blast3r


SendClientMessage(playerid, COLOR_GOLD, "To re-start the vehicle's engine press \"Shift\" or type \"/engine\"");

Is that copied from somewhere? Because you didn't actually add the OnPlayerKeyState code for the shift key -.-

EDIT: you also didn't define the "vehEngine[MAX_VEHICLES]"

5 Woah. on Tue Oct 22, 2013 11:55 am

Spanker


Thanks!

6 Re: Simple Engine System on Sat Mar 29, 2014 1:24 pm

Rolux


Useful for RP

Sponsored content


Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum