16.04.2015, 00:23
hi i have a commands /loadtruck, its create checkpoint that must Load the truck.. but the problem is when i in near the checkpoint is nothing happen, btw in my script when near in load checkpoint it create new checkpoint to unload the truck.. #sorry4badEng xD
this my code
This code when player near Load truck checkpoint
this my code
Код:
CMD:loadtruck(playerid, params[])
{
if(Work[playerid] == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
SetPlayerCheckpoint(playerid, 2509.2415,-2077.5667,13.5469, 7.0);
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}go to the checkpoint in the map to Load your truck");
Work[playerid] = 1;
}
else return SendClientMessage(playerid, -1, "** you must have trailer to start job");
}
else return SendClientMessage(playerid, -1, "** you must in the truck");
}
else return SendClientMessage(playerid, -1, "** you are still in job");
return 1;
}
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2509.2415,-2077.5667,13.5469)) // Load Truck Checkpoint
{
SetTimerEx("LoadMats", 5000, false, "i", playerid);
GameTextForPlayer(playerid, "~r~Loading Truck", 3000, 3);
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
}
for (new i; i != sizeof (TruckingUnload); ++i)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[i][0], TruckingUnload[i][1], TruckingUnload[i][2]))
{
GivePlayerMoney(playerid, 4000);
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}you have passed trucking job and get reward $4.000");
DisablePlayerCheckpoint(playerid);
Work[playerid] = 0;
break;
}
}
return 1;
}


