15.09.2013, 17:03
It didn't work. Here is OnPlayerStateChange
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(Spectate[i] == playerid)
{
PlayerSpectatePlayer(i, playerid);
}
}
}
if (newstate == PLAYER_STATE_DRIVER)
{
SetPlayerArmedWeapon(playerid, 0);
}
new string[128];
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
new vehicle = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
{
SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
SetTimerEx("engine2", 2500, false, "i", playerid);
}
else if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
{
SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
SetTimerEx("engine2", 2500, false, "i", playerid);
}
if(newstate == PLAYER_STATE_DRIVER && (pveh == 420 || pveh == 438))
{
SetRealMoney(playerid, ScriptMoney[playerid]);
}
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
{
ScriptWeaponsUpdated[playerid] = 1;
SetTimerEx("UpdateWeapons",500,false,"i",playerid);
}
if(newstate == PLAYER_STATE_ONFOOT)
{
TogglePlayerControllable(playerid, 1);
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
else if(PlayerInfo[playerid][pTesterDuty] == 1)
{
Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Tester On Duty \n Do NOT Attack",0x00AA0099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
if(TransportDuty[playerid] > 0)
{
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(string, sizeof(string), "* You are now Off Duty and earned $%d.", TransportMoney[playerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeGivePlayerMoney(playerid, TransportMoney[playerid]);
/*ConsumingMoney[playerid] = 1;*/
TransportValue[playerid] = 0;
TransportMoney[playerid] = 0;
SetPlayerToTeamColor(playerid);
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
if(IsPlayerConnected(TransportDriver[playerid]))
{
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
TransportTime[TransportDriver[playerid]] = 0;
TransportCost[TransportDriver[playerid]] = 0;
format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
GameTextForPlayer(playerid, string, 5000, 1);
format(string, sizeof(string), "~w~Passenger left the taxi~n~~g~Earned $%d",TransportCost[playerid]);
GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
SafeGivePlayerMoney(playerid, -TransportCost[playerid]);
TransportCost[playerid] = 0;
TransportTime[playerid] = 0;
TransportDriver[playerid] = 999;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
}
if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new vehicleid = GetPlayerVehicleID(playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
{
if(GetPlayerMoney(playerid) < TransportValue[i])
{
format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeRemovePlayerFromVehicle(playerid);
}
else
{
if(TransportDuty[i] == 1)
{
format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Passenger %s has entered your Taxi.", name);
SendClientMessage(i, COLOR_WHITE, string);
TransportTime[i] = 1;
TransportTime[playerid] = 1;
TransportCost[playerid] = TransportValue[i];
TransportCost[i] = TransportValue[i];
TransportDriver[playerid] = i;
}
else if(TransportDuty[i] == 2)
{
format(string, sizeof(string), "* You paid $%d to the Bus Driver.", TransportValue[i]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Passenger %s has entered your Bus.", name);
SendClientMessage(i, COLOR_WHITE, string);
}
SafeGivePlayerMoney(playerid, - TransportValue[i]);
TransportMoney[i] += TransportValue[i];
}
}
}
}
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
else if(PlayerInfo[playerid][pTesterDuty] == 1)
{
Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Tester On Duty \n Do NOT Attack",0x00AA0099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
}
if(newstate == PLAYER_STATE_DRIVER)
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
TextDrawShowForPlayer(playerid, Textdraw39[playerid]);
TextDrawShowForPlayer(playerid, Textdraw40[playerid]);
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
else if(PlayerInfo[playerid][pTesterDuty] == 1)
{
Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Tester On Duty \n Do NOT Attack",0x00AA0099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
if(IsASalesVehicle(newcar))
{
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~w~Welcome, type ~b~/v buy ~w~to buy this car, or ~b~/exit~w~ if you don't wanna buy it!",10000,4);
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Sales Car");
}
else
{
if(PlayerInfo[playerid][pCarLic] < 0)
{
if(GetPlayerDrunkLevel(playerid) >= 6000)
{
WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Drunk Driving");
}
}
else if(GetPlayerDrunkLevel(playerid) >= 6000)
{
WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Drunk Driving");
}
}
if(IsModelABoat(newcar))
{
if(PlayerInfo[playerid][pBoatLic] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You don't know how to Sail yet, so you left the Boat !");
SafeRemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
else if(IsModelAPlane(newcar) || IsModelAHeli(newcar))
{
if(PlayerInfo[playerid][pFlyLic] < 1)
{
if(TakingLesson[playerid] == 1) { }
else {
SendClientMessage(playerid, COLOR_GREY, "* You don't know how to Fly yet, so you left the Plane !");
SafeRemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1); }
}
}
else
{
if(PlayerInfo[playerid][pCarLic] == 0)
{
if(TakingLesson[playerid] == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, " You Don't have a Drivers License yet! so drive carefully or the cops will notice.");
}
}
}
if(IsAnOwnableCar(newcar))
{
if(PlayerInfo[playerid][pPcarkey] == newcar) { CanTurnEngine[playerid] = newcar; }
else if(PlayerInfo[playerid][pPcarkey2] == newcar) { CanTurnEngine[playerid] = newcar; }
else if(PlayerInfo[playerid][pPcarkey3] == newcar) { CanTurnEngine[playerid] = newcar; }
else
{
if(PlayerInfo[playerid][pAdmin] >= 5 && PlayerInfo[playerid][pAdminDuty] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You can drive this car because you are admin on duty !");
}
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
}
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Ownable Car");
}
else if(IsAnAmbulance(newcar))
{
if(PlayerInfo[playerid][pMember]== 4 && JobDuty[playerid] == 1 || PlayerInfo[playerid][pLeader]== 4 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Ambulance");
}
else if(IsACopCar(newcar))
{
if(IsAFreecop(playerid) && PlayerInfo[playerid][pDuty] == 1 || PlayerInfo[playerid][pMember]== 1 && PlayerInfo[playerid][pDuty] == 1 || PlayerInfo[playerid][pLeader]== 1 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Cop Car");
}
else if(IsAMS13Car(newcar))
{
if(PlayerInfo[playerid][pMember]== 12 && JobDuty[playerid] == 1 || PlayerInfo[playerid][pLeader]== 12 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: MS13 Car");
}
else if(IsAnFbiCar(newcar))
{
if(PlayerInfo[playerid][pMember]== 2 && PlayerInfo[playerid][pDuty] == 1 || PlayerInfo[playerid][pLeader]== 2 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: FBI Car");
}
else if(IsNgCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pDuty] == 1 || PlayerInfo[playerid][pLeader]== 3 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6)
{
CanTurnEngine[playerid] = newcar;
}
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: NG Car");
}
else if(IsASwatCar(newcar))
{
if(PlayerInfo[playerid][pMember]== 1 && PlayerInfo[playerid][pDuty] == 1 && PlayerInfo[playerid][pSwat]>= 1 || PlayerInfo[playerid][pLeader]== 1 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessage(playerid, COLOR_LIGHT_BLUE,"[DEBUG]: SWAT Car");
}
else if(IsATacticalCar(newcar))
{
if(PlayerInfo[playerid][pMember]== 2 && PlayerInfo[playerid][pDuty] == 1 && PlayerInfo[playerid][pTactical] >= 1 || PlayerInfo[playerid][pLeader]== 2 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Tactical Car");
}
else if(IsASpecialFCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pDuty] == 1 && PlayerInfo[playerid][pSpecialF] >= 1 || PlayerInfo[playerid][pLeader]== 3 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: SpecialF Car");
}
else if(IsAGovernmentCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 7||PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Government Car");
}
else if(IsAGangCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 5||PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Surenos Car");
}
else if(IsAGangCar2(newcar))
{
if(PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Signatra Car");
}
else if(IsAGangCar3(newcar))
{
if(PlayerInfo[playerid][pLeader] == 14||PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Yamaguchi Car");
}
else if(IsAGangCar4(newcar))
{
if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Corleone car");
}
else if(IsAGangCar5(newcar))
{
if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Vice Car");
}
else if(IsAGangCar6(newcar))
{
if(PlayerInfo[playerid][pLeader] == 13||PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Anarchy Car");
}
else if(IsAGangCar7(newcar))
{
if(PlayerInfo[playerid][pLeader] == 8 ||PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
}
if(cDebug == 1) SendClientMessageToAll(COLOR_LIGHT_BLUE,"[DEBUG]: Hitmen Car");
}
else if(IsAPizzabike(newcar))
{
if(PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6) { CanTurnEngine[playerid] = newcar; }
else {
CanTurnEngine[playerid] = 9999;
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this bike.");}
}
else if(IsABus(newcar))
{
if(PlayerInfo[playerid][pJob] == 14 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 6)
{
GameTextForPlayer(playerid, "~w~Use /starteast or /startwest to begin your bus route", 5000, 3);
SendClientMessage(playerid, COLOR_YELLOW2, "You have entered a bus, type /exit to cancel route selection.");
SendClientMessage(playerid, COLOR_YELLOW2, "To start doing the west route, use /startwest. To start doing the east route, use /starteast.");
new routezonecheck = IsInBusrouteZone(playerid);
if (routezonecheck == 0) SendClientMessage(playerid, COLOR_YELLOW, "Note: Your nearest route is east.");
else if (routezonecheck == 1) SendClientMessage(playerid, COLOR_YELLOW, "Note: Your nearest route is west.");
TogglePlayerControllable(playerid, 0);
CanTurnEngine[playerid] = newcar;
}
}
else if(IsATruck(newcar))
{
if(PlayerInfo[playerid][pJob] == 16)
{
format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_WHITE, "INFO: You can deliver Products to Businesses.");
SendClientMessage(playerid, COLOR_WHITE, "INFO: Commands are /load /buyprods /sellprods");
}
CanTurnEngine[playerid] = newcar;
}
else if(IsASweeper(newcar))
{
if(PlayerInfo[playerid][pJob] == 21)
{
if(PlayerIsSweeping[playerid] == 0)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~g~/startsweep ~w~ to start sweeping~n~Type ~r~/exit ~w~to leave the sweeper", 5000, 3);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You can stop sweeping by typing /stopsweep .");
}
}
CanTurnEngine[playerid] = newcar;
}
else if(IsARentableVeh(newcar))
{
if (HireCar[playerid] != newcar)
{
format(string, sizeof(string), "~w~You can Rent this bike~n~Cost:~g~$%d~n~~w~To rent type ~g~/Rentveh~w~~n~to get out type ~r~/exit",SBizzInfo[0][sbEntranceCost]);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, string, 5000, 3);
CanTurnEngine[playerid] = 9999;
}
else
{
CanTurnEngine[playerid] = newcar;
}
}
else if(IsAHarvest(newcar))
{
if(PlayerInfo[playerid][pJob] == 18)
{
if(FarmerVar[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "___________Farmer guide___________");
SendClientMessage(playerid, COLOR_WHITE, "** Farmer ** /startharvest, /stopharvest or /exit");
SendClientMessage(playerid, COLOR_RED, "__________________________________");
TogglePlayerControllable(playerid, 0);
}
else { }
}
CanTurnEngine[playerid] = newcar;
}
else if(IsADrugHarvest(newcar))
{
if(PlayerInfo[playerid][pJob] == 19)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "____________Drug farmer guide____________");
SendClientMessage(playerid, COLOR_WHITE, "** Drug farmer ** /startdrugharvest, /stopdrugharvest or /exit");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "_________________________________________");
TogglePlayerControllable(playerid, 0);
}
CanTurnEngine[playerid] = newcar;
}
else if(IsASmuggleCar(newcar))
{
if(PlayerInfo[playerid][pJob] == 20)
{
SendClientMessage(playerid, COLOR_YELLOW, "HINT: You can smuggle drugs now !");
}
CanTurnEngine[playerid] = newcar;
}
else
{
CanTurnEngine[playerid] = newcar;
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}
return 1;
}