I want to use my GasStation array
#10

pawn Код:
new Float:gx, Float:gy, Float:gz;
    for(new i = 0; i < sizeof(GasStation); i++)
    {
        gx = GasStation[i][0];
        gy = GasStation[i][1];
        gz = GasStation[i][2];
    }
    SetPlayerMapIcon(playerid, 0, gx, gy, gz, 56, COLOR_WHITE, MAPICON_LOCAL);
Thatwill only set the last map icon. Use it like htis
pawn Код:
new Float:gx, Float:gy, Float:gz;
    for(new i = 0; i < sizeof(GasStation); i++)
    {
        gx = GasStation[i][0];
        gy = GasStation[i][1];
        gz = GasStation[i][2];
SetPlayerMapIcon(playerid, 0, gx, gy, gz, 56, COLOR_WHITE, MAPICON_LOCAL);
    }
pawn Код:
for(new i = 0; i < sizeof(GasStation); i++)
{
    x = GasStation[i][0];
    y = GasStation[i][1];
    z = GasStation[i][2];
    if(IsPlayerInRangeOfPoint(playerid, 2.5, x, y, z) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(isrefuelling[playerid]) return SendClientMessage(playerid, COLOR_RED, "You are already refuelling!");
        if (GetPlayerMoney(playerid) - 80 < 0) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to refuel!");
        GivePlayerMoney(playerid, -80);
        SetCameraBehindPlayer(playerid);
        TogglePlayerControllable(playerid, 0);
        isrefuelling[playerid] = 1;
        TextDrawSetString(td_fuel[playerid], "Refuelling...");
        GameTextForPlayer(playerid, "~r~Refuelling...~n~~w~Please wait!", 5000, 3);
        SetTimerEx("VehicleRefuel", 5000, false, "i", playerid);
    }
    else if(!IsPlayerInRangeOfPoint(playerid, 2.5, x, y, z)) return SendClientMessage(playerid, COLOR_RED, "You are not in any Gas Stations!");
}
Same for your pickups, you have to create the pickups inside the loop else it just won't work.
Reply


Messages In This Thread
I want to use my GasStation array - by JaKe Elite - 09.10.2012, 09:33
Re: I want to use my GasStation array - by Roel - 09.10.2012, 09:38
Re: I want to use my GasStation array - by JaKe Elite - 09.10.2012, 09:41
Re: I want to use my GasStation array - by mamorunl - 09.10.2012, 10:26
Re: I want to use my GasStation array - by JaKe Elite - 09.10.2012, 10:31
Re: I want to use my GasStation array - by XtremeR - 09.10.2012, 10:42
Re: I want to use my GasStation array - by JaKe Elite - 09.10.2012, 10:46
Re: I want to use my GasStation array - by XtremeR - 09.10.2012, 11:06
Re: I want to use my GasStation array - by JaKe Elite - 09.10.2012, 11:57
Re: I want to use my GasStation array - by Roel - 09.10.2012, 12:07

Forum Jump:


Users browsing this thread: 3 Guest(s)