[Ajuda] CreateDynamicCP
#5

Um exemplo abaixo:

PHP Code:
static
    
Float:ShipmentList[][] = {
        {
1963.38641362.41669.2578},
        {
1970.60911367.92149.2578},
        {
1985.44791368.97019.2501},
        {
1991.42991369.21319.2578},
        {
2003.62301368.71469.2578},
        {
2015.50401359.73399.4377},
        {
2023.86071351.562610.4617},
        {
2033.31521341.536110.8203},
        {
2035.14811330.544110.8203},
        {
2023.88371334.477710.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(playeridShipmentList[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(playeridShipmentList[index][0], ShipmentList[index][1], ShipmentList[index][2], 3.0);
        
LastShipment[playerid] = index;
    }
    return 
1;

Reply


Messages In This Thread
CreateDynamicCP - by moura98 - 11.04.2019, 16:35
Re: CreateDynamicCP - by Ermanhaut - 12.04.2019, 08:29
Re: CreateDynamicCP - by moura98 - 12.04.2019, 10:10
Re: CreateDynamicCP - by Cauezin - 12.04.2019, 22:18
Re: CreateDynamicCP - by 1sbedx - 13.04.2019, 01:35

Forum Jump:


Users browsing this thread: 2 Guest(s)