13.04.2019, 01:35
Um exemplo abaixo:
PHP Code:
static
Float:ShipmentList[][] = {
{1963.3864, 1362.4166, 9.2578},
{1970.6091, 1367.9214, 9.2578},
{1985.4479, 1368.9701, 9.2501},
{1991.4299, 1369.2131, 9.2578},
{2003.6230, 1368.7146, 9.2578},
{2015.5040, 1359.7339, 9.4377},
{2023.8607, 1351.5626, 10.4617},
{2033.3152, 1341.5361, 10.8203},
{2035.1481, 1330.5441, 10.8203},
{2023.8837, 1334.4777, 10.4626}
},
Shipments[MAX_PLAYERS],
LastShipment[MAX_PLAYERS];
CMD:carregar(playerid) {
Shipments[playerid] = 5;
SendClientMessage(playerid, -1, "Vocк recebeu 5 remessas, entregue-as!");
new
index = random(sizeof(ShipmentList));
SetPlayerCheckpoint(playerid, ShipmentList[index][0], ShipmentList[index][1], ShipmentList[index][2], 3.0);
LastShipment[playerid] = index;
return 1;
}
public OnPlayerEnterCheckpoint(playerid) {
if (Shipments[playerid]) {
if (!(-- Shipments[playerid])) {
SendClientMessage(playerid, -1, "Vocк entregou todas as remessas.");
DisablePlayerCheckpoint(playerid);
return 1;
}
new
index = random(sizeof(ShipmentList));
while (index == LastShipment[playerid])
index = random(sizeof(ShipmentList));
SetPlayerCheckpoint(playerid, ShipmentList[index][0], ShipmentList[index][1], ShipmentList[index][2], 3.0);
LastShipment[playerid] = index;
}
return 1;
}