30.04.2016, 09:06
Okay, i found this :
I think this code will set up the checkpoint for truck but after try to change pos in table I still can't get a checkpoint after delivery all crates to the vehicle . Any help? Please!
P/S: sorry about bad English
PHP код:
if (PlayerData[playerid][pLoadCrate])
{
for (new i = 1; i != MAX_VEHICLES; i ++) if (IsPlayerNearBoot(playerid, i))
{
if (!IsLoadableVehicle(i))
return SendErrorMessage(playerid, "You can't load crates into this vehicle.");
if (CoreVehicles[i][vehLoadType] != 0 && CoreVehicles[i][vehLoadType] != PlayerData[playerid][pLoadType])
return SendErrorMessage(playerid, "This vehicle is already loaded with something else.");
if (CoreVehicles[i][vehLoads] >= 6)
return SendErrorMessage(playerid, "This vehicle can only hold up to 6 crates.");
CoreVehicles[i][vehLoads]++;
CoreVehicles[i][vehLoadType] = PlayerData[playerid][pLoadType];
ApplyAnimation(playerid, "CARRY", "putdwn", 4.0, 0, 0, 0, 0, 0);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s drops a crate into the back of the %s.", ReturnName(playerid, 0), ReturnVehicleName(i));
if (CoreVehicles[i][vehLoads] == 6)
{
DisablePlayerCheckpoint(playerid);
if (PlayerData[playerid][pShipment] != -1)
{
PlayerData[playerid][pDeliverShipment] = 1;
SendServerMessage(playerid, "You have loaded all the crates. Type /unload at the marker.");
SetPlayerCheckpoint(playerid, BusinessData[PlayerData[playerid][pShipment]][bizDeliver][0], BusinessData[PlayerData[playerid][pShipment]][bizDeliver][1], BusinessData[PlayerData[playerid][pShipment]][bizDeliver][2], 3.0);
}
else switch (PlayerData[playerid][pLoadType])
{
case 1: SendServerMessage(playerid, "You have loaded all the crates. Type /unload at any retail store.");
case 2: SendServerMessage(playerid, "You have loaded all the crates. Type /unload at any weapon store.");
case 3: SendServerMessage(playerid, "You have loaded all the crates. Type /unload at any clothing store.");
case 4: SendServerMessage(playerid, "You have loaded all the crates. Type /unload at any fast food store.");
case 5: SendServerMessage(playerid, "You have loaded all the crates. Type /unload at any gas station.");
case 6: SendServerMessage(playerid, "You have loaded all the crates. Type /unload at any furniture store.");
}
PlayerData[playerid][pLoading] = 0;
PlayerData[playerid][pLoadType] = 0;
}
PlayerData[playerid][pLoadCrate] = 0;
RemovePlayerAttachedObject(playerid, 4);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
return 1;
}
}
P/S: sorry about bad English