06.12.2012, 20:59
Hey, I'm having problems with jobs. For example, farmer, when I use /milkcow it sets a checkpoint, and then its supposed to set another checkpoint but it doesnt =/ Need help if any1 can help me solve it, there are no errors or any warnings. Here's the code;
milkcow cmd:
and the other checkpoints, under onplayerentercheckpoint;
thanks a lot for helpers
milkcow cmd:
PHP код:
CMD:milkcow(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 23 || PlayerInfo[playerid][pJob2] == 23)
{
if(PlayerInfo[playerid][pMilkTime] == 0)
{
if(IsMilkingCows[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " *INFO: Milk all of the cows, then go to into the barn to finish.");
SetPlayerCheckpoint(playerid, -400.5316,-1352.9856,24.4025, 1.0);
IsMilkingCows[playerid] = 1;
PlayerInfo[playerid][pMilkTime] += 1800;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are already milking the cows !");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Wait until the cows are ready to be milked again!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You are not a Farmer.");
return 1;
}
}
return 1;
}
PHP код:
else if(IsMilkingCows[playerid] > 0)//farmerjob
{
if(IsMilkingCows[playerid] == 1)
{
MilkTime[playerid] += 1;
TogglePlayerControllable(playerid, 0);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -415.4362,-1367.9500,23.7354,1.0);
IsMilkingCows[playerid] = 2;
}
else if(IsMilkingCows[playerid] == 2)
{
MilkTime[playerid] += 1;
TogglePlayerControllable(playerid, 0);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -429.1931,-1357.7994,24.1332,1.0);
IsMilkingCows[playerid] = 3;
}
else if(IsMilkingCows[playerid] == 3)
{
MilkTime[playerid] += 1;//1
TogglePlayerControllable(playerid, 0);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -419.0900,-1347.9215,24.7898,1.0);
IsMilkingCows[playerid] = 4;
}
else if(IsMilkingCows[playerid] == 4)
{
MilkTime[playerid] += 1;
TogglePlayerControllable(playerid, 0);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -404.1791,-1325.3143,26.9061,1.0);
IsMilkingCows[playerid] = 5;
}
else if(IsMilkingCows[playerid] == 5)
{
MilkTime[playerid] += 1;
TogglePlayerControllable(playerid, 0);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -426.7935,-1327.0194,28.7070,1.0);
IsMilkingCows[playerid] = 6;
}
else if(IsMilkingCows[playerid] == 6)
{
CowEndTime[playerid] += 1;
TogglePlayerControllable(playerid, 0);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -366.2761,-1428.3999,25.7266,3.0);
IsMilkingCows[playerid] = 7;
}
else if(IsMilkingCows[playerid] == 7)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, " Well Done! Here's your Pay Check of $100");
IsMilkingCows[playerid] = 0;
GivePlayerMoney(playerid, 100);
}
