I want to use my GasStation array
#9

Now i've bigger problem.

The map icon doesn't work.
And even the refuel system doesn't work

every time i press Y it says i'm not in any gas stations
even i'm in the refuel pickup.

I test this.

pawn Код:
//OnPlayerSpawn

    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);

//OnPlayerKeyStateChange

    new Float:x, Float:y, Float:z;
    if(newkeys & KEY_YES)
    {
        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!");
    }
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: 5 Guest(s)