if(strcmp(cmd, "/engine", true) == 0)//start
{
if(IsPlayerConnected(playerid))
{
new VID;
VID = GetPlayerVehicleID(playerid);
//new idcar = GetPlayerVehicleID(playerid);
if(CarRunning[VID] == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsASalesVehicle(VID))
{
SendClientMessage(playerid, COLOR_WHITE, "[INFO] - You can not take a vehicle from one of the Dealership's");
return 1;
}
if(IsAHarvester(VID))
{
if(PlayerInfo[playerid][pJob] == 21)
{
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;
}
if(IsAnOwnableCar(VID))
{
if(PlayerInfo[playerid][pPcarkey] == VID) { }
else if(PlayerInfo[playerid][pPcarkey2] == VID) { }
else if(PlayerInfo[playerid][pPcarkey3] == VID) { }
else if(PlayerInfo[playerid][pPcarkey4] == VID) { }
else if(PlayerInfo[playerid][pPcarkey5] == VID) { }
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s rips off the ignition cover.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
EnterCarTimeH[playerid] += 1;
return 1;
}
}
if(IsATaxi(VID))
{
if(PlayerInfo[playerid][pJob] == 14)
{
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;
}
if(VID >= 1 && VID <= 20)
{
if(HireCar[playerid] != VID)
{
return 1;
}
}
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 if(CarRunning[VID] == 1)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(VID))
{
if(PlayerInfo[playerid][pPcarkey] == VID) { }
else if(PlayerInfo[playerid][pPcarkey2] == VID) { }
else if(PlayerInfo[playerid][pPcarkey3] == VID) { }
else if(PlayerInfo[playerid][pPcarkey4] == VID) { }
else if(PlayerInfo[playerid][pPcarkey5] == VID) { }
else { return 1; }
}
if(IsATaxi(VID))
{
if(PlayerInfo[playerid][pJob] == 14)
{
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);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
CarRunning[VID] = 0;
}
return 1;
}
if(VID >= 1 && VID <= 20)
{
if(HireCar[playerid] != VID)
{
return 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);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
CarRunning[VID] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a car !");
return 1;
}
}
}
if(EnterCarTimeH[i] >= 1)//start
{
EnterCarTimeH[i] += 1;
VID = GetPlayerVehicleID(i);
GetVehicleHealth(VID, Vehhp);
if(EnterCarTimeH[i] == 3)
{
//GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has attempted to Start the vehicle", GetPlayerNameEx(i));
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
EnterCarTimeH[i] = 0;
EnterCarTime[i] += 1;
}
}
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)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
SendClientMessage(i, TEAM_GROVE_COLOR, " The engine is now running, Drive Safely");
GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(VID,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
//TogglePlayerControllable(i, 1);
CarRunning[VID] = 1;
EnterCarTime[i] = 0;
}
else
{
new engine,lights,alarm,doors,bonnet,boot,objective;
SendClientMessage(i, COLOR_RED," You failed to start your car !");
SendClientMessage(i, COLOR_RED, " Check your Gauges !");
GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
EnterCarTime[i] = 0;
}
}
}
if(strcmp(cmd, "/engine", true) == 0)//start
{
if(IsPlayerConnected(playerid))
{
new VID;
VID = GetPlayerVehicleID(playerid);
//new idcar = GetPlayerVehicleID(playerid);
if(CarRunning[VID] == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsASalesVehicle(VID))
{
SendClientMessage(playerid, COLOR_WHITE, "[INFO] - You can not take a vehicle from one of the Dealership's");
return 1;
}
if(IsAHarvester(VID))
{
if(PlayerInfo[playerid][pJob] == 21)
{
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;
}
if(IsAnOwnableCar(VID))
{
if(PlayerInfo[playerid][pPcarkey] == VID) { }
else if(PlayerInfo[playerid][pPcarkey2] == VID) { }
else if(PlayerInfo[playerid][pPcarkey3] == VID) { }
else if(PlayerInfo[playerid][pPcarkey4] == VID) { }
else if(PlayerInfo[playerid][pPcarkey5] == VID) { }
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s rips off the ignition cover.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
EnterCarTimeH[playerid] += 1;
return 1;
}
}
if(IsATaxi(VID))
{
if(PlayerInfo[playerid][pJob] == 14)
{
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;
}
if(VID >= 1 && VID <= 20)
{
if(HireCar[playerid] != VID)
{
return 1;
}
}
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 if(CarRunning[VID] == 1)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(VID))
{
if(PlayerInfo[playerid][pPcarkey] == VID) { }
else if(PlayerInfo[playerid][pPcarkey2] == VID) { }
else if(PlayerInfo[playerid][pPcarkey3] == VID) { }
else if(PlayerInfo[playerid][pPcarkey4] == VID) { }
else if(PlayerInfo[playerid][pPcarkey5] == VID) { }
else { return 1; }
}
if(IsATaxi(VID))
{
if(PlayerInfo[playerid][pJob] == 14)
{
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);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
CarRunning[VID] = 0;
}
return 1;
}
if(VID >= 1 && VID <= 20)
{
if(HireCar[playerid] != VID)
{
return 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);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
CarRunning[VID] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a car !");
return 1;
}
}
return 1;
}
pawn Код:
|