15.11.2013, 01:25
Well, I am making buy-able spawns for my RP server... I have an array of their coordinates...Just for example this is what it looks like.
pawn Code:
enum SpawnInfo {X, Y, Z, R}
new Float:BoughtSpawns[][SpawnInfo] =
{
(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)
};
new BS[(sizeof(BoughtSpawns)];
pawn Code:
for(new i = 0; i < sizeof(BoughtSpawns); i++)
{
BS[i] = CreateDynamicPickup(1313, 1, BoughtSpawns[i][X], BoughtSpawns[i][Y], BoughtSpawns[i][Z]);
}
Also! How would I show this message when a player picks up any of these pickups...
Would this work?
pawn Code:
for(new o = -1; o < sizeof(BS); o++)
{
if(pickupid == o && IsValidDynamicPickup(o))
{
GameTextForPlayer(playerid, "~l~~h~DO ~g~/buyspawn ~l~~h~TO BUY THIS SPAWN!", 2000, 5);
}
}