25.05.2012, 15:27
Hey guys. Well, i made 2 jobs. Street sweeping, and Trucking, but trucking is sending me to sweeping checkpoints..
Here is the code, thanks.
Here is the code, thanks.
pawn Код:
new Float:BCP[][3] =
{
{-2231.5911,-2456.8728,30.4688},
{-2130.9924,-2532.9590,30.4688},
{-1982.1638,-2538.2822,36.8082},
{-2259.3906,-2561.3916,31.9347}
};
new Float:TCP[][3] =
{
{-1565.1646,-2811.4785,46.6490},
{-2130.9924,-2532.9590,30.4688},
{-199.8498,-2335.5718,28.4854},
{-56.6326,-1136.9395,1.0781}
};
new sCP[MAX_PLAYERS];
new tCP[MAX_PLAYERS];
CMD:startsweep(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 574)
{
SetPlayerCheckpoint(playerid, -2106.6787,-2361.6228,30.4688, 5.0);
sCP[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "You started your job. Follow the checkpoints.");
return 1;
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not inside any sweeping vehicle.");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a sweeper.");
}
CMD:starttruck(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 2)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 514)
{
if(IsTrailerAttachedToVehicle(vehicleid))
{
SetPlayerCheckpoint(playerid, -2051.4927,-2488.2144,30.1957, 5.0);
tCP[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "You started your job. Follow the checkpoint.");
return 1;
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "No trailler is attached.");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not inside any Trucking vehicle.");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a trucker.");
}
public OnPlayerEnterCheckpoint(playerid)
{
if(sCP[playerid] != -1)
{
GivePlayerMoney(playerid, 40);
if(sCP[playerid] < (sizeof(BCP) - 1))
{
sCP[playerid]++;
SetPlayerCheckpoint(playerid, BCP[sCP[playerid]][0], BCP[sCP[playerid]][1], BCP[sCP[playerid]][2], 5.0);
}
else
{
SendClientMessage(playerid, 0x999999AA, "Route finished");
DisablePlayerCheckpoint(playerid);
sCP[playerid] = -1;
}
}
if(tCP[playerid] != -1)
{
GivePlayerMoney(playerid, 250);
if(tCP[playerid] < (sizeof(TCP) - 1))
{
tCP[playerid]++;
SetPlayerCheckpoint(playerid, TCP[tCP[playerid]][0], TCP[tCP[playerid]][1], TCP[tCP[playerid]][2], 5.0);
}
else
{
SendClientMessage(playerid, 0x999999AA, "Route finished");
DisablePlayerCheckpoint(playerid);
tCP[playerid] = -1;
}
}
}