13.04.2010, 18:16
Hey All
I have this Engine system, I want to make it with the cmd /engine And with the key of shift, When i push shift its starts the engine..
This is the lines:
And this too:
Last one:
Well, Ive putted all of these 3 codes, If you need them, I dont know How to add it on my gm..
What I want is, That the /start will be same, PLUS the Key Shift
Thanks All!!
I'll Be very thankful The oen who can help me!
I have this Engine system, I want to make it with the cmd /engine And with the key of shift, When i push shift its starts the engine..
This is the lines:
pawn Код:
if(strcmp(cmd, "/start", true) == 0)//start
{
if(IsPlayerConnected(playerid))
{
if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0))
if(newkeys == KEY_JUMP)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " %s has attempted to Start the vehicle", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
EnterCarTime[playerid] += 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a Vehicle!");
return 1;
}
}
}
if(strcmp(cmd,"/stop", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new VID;
VID = GetPlayerVehicleID(playerid);
if(CarRunning[VID] == 1)
{
GetPlayerName(playerid,sendername,sizeof(sendername));
format(string, sizeof(string), "** %s Turns Their Car off.",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(playerid, 0);
CarRunning[VID] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Your car is already off.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a car !");
return 1;
}
}
}
pawn Код:
if(EnterCarTime[i] >= 1)//start
{
EnterCarTime[i] += 1;
VID = GetPlayerVehicleID(i);
GetVehicleHealth(VID, Vehhp);
if(EnterCarTime[i] == 3)
{
if(CarWires[VID] == 0 && Vehhp > 400 && Gas[VID] > 3)
{
SendClientMessage(i, TEAM_GROVE_COLOR, " The engine is now running, Drive Safely");
TogglePlayerControllable(i, 1);
CarRunning[VID] = 1;
EnterCarTime[i] = 0;
}
else
{
SendClientMessage(i, COLOR_RED," You failed to start your car ");
SendClientMessage(i, COLOR_RED, " Check your engine!");
EnterCarTime[i] = 0;
}
}
}
pawn Код:
if(CarRunning[newcar] == 0)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(IsABicyle(newcar))
{
SendClientMessage(playerid, COLOR_PURPLE, "Status: Ready to ride.");
return 1;
}
if(IsARC(vehicleid))
{
SendClientMessage(playerid, COLOR_PURPLE, "Status: Ready to drive.");
return 1;
}
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_PURPLE, "Status: To start the engine, Switch the car keys by(Shift Key)OR(/engine)");
}
if(CarRunning[newcar] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Status: The engine is Running ");
}
if(CarWires[newcar] != 0)
{
SendClientMessage(playerid, COLOR_RED, "Status: Ignition wires are damaged ");
}
if(Vehhp <= 400)
{
SendClientMessage(playerid, COLOR_RED, "Status: **Engine light indicates** Engine Repairs needed.");
ShowPlayerDialog(playerid, MECHANICMENU, DIALOG_STYLE_LIST, "What would you like to do?","Call Mechanic\nExit Vehicle ", "Select", "Cancel");
}
if(Gas[newcar] < 4)
{
SendClientMessage(playerid, COLOR_RED, " Status: **Fuel Light Indicates** Re-Fill needed. ");
ShowPlayerDialog(playerid, MECHANICMENU, DIALOG_STYLE_LIST, "What would you like to do?","Call Mechanic\nExit Vehicle ", "Select", "Cancel");
}
if(IsABoat(newcar))
{
if(PlayerInfo[playerid][pBoatLic] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " You don't know how to Sail yet, so you left the Boat !");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
What I want is, That the /start will be same, PLUS the Key Shift
Thanks All!!
I'll Be very thankful The oen who can help me!