17.02.2014, 06:57
When mowerjob is false and i exit the mower, I still get the msg as if it was true; , I'm a bit tired so if anyone can help me out a little would be appreciated
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT) // Player entered a vehicle as a driver
{
if(GetVehicleModel(vehicleid) == 572 && MowerJob[playerid] == true)
{
MowerJob[playerid] = false;
SendClientMessage(playerid,-1,"{00E4FF}[LAWN MOWING]{FFFFFF} You have left your vehicle, mission has been {FF0000}cancelled.");
return 1;
}
else if(GetVehicleModel(vehicleid) == 572 && MowerJob[playerid] == false)
{
SendClientMessage(playerid,-1,"{00E4FF}[LAWN MOWING]{FFFFFF} You left your mower, mowerjob was already 0.");
return 1;
}
return 1;
}
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
{
if(GetVehicleModel(vehicleid) == 572)
{
if(MowerJob[playerid] == false)
{
SendClientMessage(playerid,-1,"{00E4FF}[LAWN MOWING]{FFFFFF} To begin this job, type {FFC500}/lawnmower {FFFFFF}or press {FFC500}2.");
GameTextForPlayer(playerid, "~w~To start a ~g~~h~~h~lawn mowing mission~w~, type ~y~/lawnmower ~w~or press ~y~2", 5000, 3);
return 1;
}
}
}
return 1;
}