Array of locations, tried different things. Not working
#1

Alright, I've tried all sorts of solutions and can't find one that works.. I've tried so many that I can't even remember half of the things I tried... It's displaying the * You are not at a gas station to refuel.

Despite being at the correct coordinates and in range of those coordinates.

Any suggestions guys? Maybe I've done something wrong that I haven't noticed.

pawn Код:
//Gas Station Coordinates
new Float:GasStations[][] =
{
{-2410.0339, 976.2402, 45.4246},
{-2686.1143, 15.3380, 7.2126}
}

for(new i; i < sizeof(GasStations); i++)
{
        if(!IsPlayerInRangeOfPoint(playerid, 10.0, GasStations[i][0], GasStations[i][1], GasStations[i][2]))
        {
            SCM(playerid, COLOR_SNOW, "* You are not at a gas station to refuel.");
            return 1;
         } 
}
Reply
#2

Try

pawn Код:
for(new i; i < sizeof(GasStations); i++)
{
        if(IsPlayerInRangeOfPoint(playerid, 10.0, GasStations[i][0], GasStations[i][1], GasStations[i][2]))
        {
// Your Code here
            return 1;
         }
         else
         // You code here  
}
Or you can try :
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10.0, GasStations[i][0], GasStations[i][1], GasStations[i][2]))
                  return SCM( bla bla );
I hope this will be works !
If not reply !
Reply
#3

Do you know what "return" does?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)