31.05.2014, 16:41
Codes:
Now whats not working? You exit car re-enter still can work.
Please help +REP
pawn Код:
#define WAIT_TIME 60000
new StreetSweeperCar[8];
new stimer;
new SweepDoAgain[MAX_PLAYERS];
// My vars.
// Creating cars.
StreetSweeperCar[0] = AddStaticVehicleEx(574,2481.6001000,1266.3000000,10.6000000,270.0000000,254,164,30); //Sweeper
StreetSweeperCar[1] = AddStaticVehicleEx(574,2481.5000000,1277.4000000,10.6000000,270.0000000,254,164,30); //Sweeper
StreetSweeperCar[2] = AddStaticVehicleEx(574,2481.3999000,1286.4000000,10.6000000,270.0000000,254,164,30); //Sweeper
StreetSweeperCar[3] = AddStaticVehicleEx(574,2481.6001000,1297.5000000,10.6000000,270.0000000,254,164,30); //Sweeper
StreetSweeperCar[4] = AddStaticVehicleEx(574,2513.7000000,1297.6000000,10.6000000,90.0000000,254,164,30); //Sweeper
StreetSweeperCar[5] = AddStaticVehicleEx(574,2513.5000000,1286.5000000,10.6000000,90.0000000,254,164,30); //Sweeper
StreetSweeperCar[6] = AddStaticVehicleEx(574,2513.6001000,1277.5000000,10.6000000,90.0000000,254,164,30); //Sweeper
StreetSweeperCar[7] = AddStaticVehicleEx(574,2513.3999000,1266.5000000,10.6000000,90.0000000,254,164,30); //Sweeper
if (newstate == PLAYER_STATE_DRIVER)
{
new vehicleidz = GetPlayerVehicleID(playerid);
if(IsStreetSweeperCar(vehicleidz))
{
if(SweepDoAgain[playerid] == 1)
{
SCM(playerid, COLOR_GREEN, "To start a sweep mission type: /sweep");
SCM(playerid, COLOR_GREEN, "You'll earn 7 euro's for sweeping one dirt.");
SCM(playerid, COLOR_RED, "Don't use it for your own or you can get BANNED!");
stimer = SetTimerEx("Sweeping", WAIT_TIME, true, "d", playerid);
SweepDoAgain[playerid] = 0;
}
else if(SweepDoAgain[playerid] == 0)
{
SCM(playerid, COLOR_RED, "You still have to wait to work again!");
}
}
}
// Player Connect
SweepDoAgain[playerid] = 1;
MowerDoAgain[playerid] = 1;
// Dissconect
SweepDoAgain[playerid] = 0;
MowerDoAgain[playerid] = 0;
// OnPlayerExitVehicle
new vehicleid2 = GetPlayerVehicleID(playerid);
if(IsStreetSweeperCar(vehicleid2)) // it is a vehicle for the driving tests
{
KillTimer(stimer);
SendClientMessage(playerid, 0x58E11EC8, "You are no longer doing your Street Sweeping Job!");
}
//public
forward Sweeping(playerid);
public Sweeping(playerid)
{
new string[128];
GivePlayerMoney(playerid, 175);
format(string, sizeof(string), "You have received Ђ175 for your Street Sweeping Job!");
SendClientMessage(playerid, 0x58E11EC8, string);
SCM(playerid, COLOR_RED, "You can work again in 5 minutes.");
RemovePlayerFromVehicle(playerid);
SetTimer("AllowAgainSweep", 60000, false);
SweepDoAgain[playerid] = 1;
return 1;
}
forward AllowAgainSweep(playerid);
public AllowAgainSweep(playerid)
{
SweepDoAgain[playerid] = 0;
return 1;
}
Please help +REP