03.02.2009, 21:27
pawn Код:
new Float:RandomSpawn[][] =
{
{1945.9650, 152.9478, 37.0099},
{1880.4320, 247.6804, 27.2093},
{2019.9969, 274.9753, 28.5537}
}, RandomPickupid;
pawn Код:
//OnGameModeInit
CreatePickupAtRandPos(1242);
pawn Код:
//OnPlayerPickUpPickup(playerid, pickupid)
if(pickupid == RandomPickupid)
{
DestroyPickup(RandomPickupid);
GivePlayerMoney(playerid, 12_500);
SetTimerEx("CreatePickupAtRandPos", 30_000, false, "i", 1242);
}
pawn Код:
forward CreatePickupAtRandPos(modelid);
public CreatePickupAtRandPos(modelid)
{
new rand = random(sizeof RandomSpawn);
RandomPickupid = CreatePickup(modelid, 3, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
}