Array of pickup coordinates.
#4

Quote:
Originally Posted by Loot
View Post
Why are you using both enum and floats when you can do all at once?
P.S I haven't tested that, so there might be an error.
pawn Code:
static Float:BoughtSpawns[11][3] =
{
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781),
    (132.0000,  -67.2844,   3.5781)
};

public OnGameModeInit()
{
     for(new i = 0; i < sizeof(BoughtSpawns); i++)
     {
         BS[i] = CreateDynamicPickup(1313, 1, BoughtSpawns[i][0], BoughtSpawns[i][1], BoughtSpawns[i][2]);
     }
     return 1;
}

//pickups public
for(new i = 0; i < sizeof(BoughtSpawns); i++)
{
     if(IsValidDynamicPickup(i))
     {
          GameTextForPlayer(playerid, "~l~~h~DO ~g~/buyspawn ~l~~h~TO BUY THIS SPAWN!", 2000, 5);
     }
}
Thats basically the same EXACT thing... Thanks anyway but, the enum is for replacing the number, well not replace but just take place as the numbers... So X = 0, Y = 1, and Z = 2... R is for my random spawns... They just make it easier for a noob scripter to understand, I am eventually releasing this, so im making it for beginners...

ALSO, you used an exact amount (the 11)... (Float:BoughtSpawns[11][3])
By using sizeof(), it automatically counts the array.

(I dont know why it double posted... I clicked EDIT POST!)
Reply


Messages In This Thread
Array of pickup coordinates. - by Crayder - 15.11.2013, 01:25
Re: Array of pickup coordinates. - by Loot - 15.11.2013, 02:13
Re: Array of pickup coordinates. - by Crayder - 15.11.2013, 02:20
Re: Array of pickup coordinates. - by Crayder - 15.11.2013, 02:28
Re: Array of pickup coordinates. - by Loot - 15.11.2013, 12:37
Re: Array of pickup coordinates. - by Threshold - 15.11.2013, 12:58
Re: Array of pickup coordinates. - by Crayder - 15.11.2013, 21:23
Re: Array of pickup coordinates. - by Pottus - 15.11.2013, 21:29
Re: Array of pickup coordinates. - by Jefff - 15.11.2013, 21:30
Re: Array of pickup coordinates. - by Threshold - 16.11.2013, 00:34

Forum Jump:


Users browsing this thread: 5 Guest(s)