05.06.2013, 10:45
Just save tons of positions in a array..
make a random and find one of this tons of positions
create a pickup or whatever you want to create in this positions..
maybe set a timer for disappear
some variables for check if is here and if is taken
and the callback for player pickup with the reward
make a random and find one of this tons of positions
create a pickup or whatever you want to create in this positions..
maybe set a timer for disappear
some variables for check if is here and if is taken
and the callback for player pickup with the reward
pawn Код:
Float:Positions[2][3] = {
{0.0,0.0,0.1719},
{0.0,0.0,0.1719}
};
new bool:IsPickupCreated,PickupID;
/commandforcreate {
if(IsPickupCreated == true) return .. the pickup is already created
new rando = random(sizeof(Positions));
PickupID = createsomepickup(someid,Positions[rando][0],Positions[rando][1],Positions[rando][2]);
IsPickupCreated = true;
SetTimer("PickupDisappear",10000,0);
}
public PickupDisappear()
{
DestroyPickup(PickupID);
IsPickupCreated = false;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == PickupID)
{
GivePlayerMoney(playerid, 2342354);
IsPickupCreated = false;
//sendclientmessage for announce the winner
}
return 1;
}