little question
#16

pawn Код:
forward CreateRandomPickup();

new RandomPickup;

new Float:RandomSpawn[4][3] =
{
  {2211.2908,2472.7927,10.8203},//Leave the same for testing purposes saves you running around.
  {2211.2908,2472.7927,10.8203},
  {2211.2908,2472.7927,10.8203},
  {2211.2908,2472.7927,10.8203}
};

new RandomModelType[2][2] =
{
  {1212,23},
  {1274,23}
};

new RandomMoney[3][1] =
{
  {5000},
  {10000},
  {15000}
};

public CreateRandomPickup()
{
  new modeltype= random(sizeof RandomModelType);
  new spawn = random(sizeof RandomSpawn);
  RandomPickup = CreatePickup(RandomModelType[modeltype][0], RandomModelType[modeltype][1], RandomSpawn[spawn][0], RandomSpawn[spawn][1], RandomSpawn[spawn][2]);
  return 1;
}

public OnGameModetInit()
{
  SetTimer("CreateRandomPickup", 60000, false);
  return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
  new RandomMoneyAmount = random(sizeof RandomMoney);
  if(pickupid == RandomPickup)
    {
      DestroyPickup(RandomPickup);
      GivePlayerMoney(playerid, RandomMoney[RandomMoneyAmount][0]);
      SetTimer("CreateRandomPickup", 20000, false);
    }
  return 1;
}
1550 seems to be a object. Just an example. I did test it.
Reply


Messages In This Thread
little question - by nesty - 07.02.2009, 22:38
Re: little question - by Auto-Sized - 07.02.2009, 22:41
Re: little question - by nesty - 07.02.2009, 22:45
Re: little question - by nesty - 07.02.2009, 23:56
Re: little question - by Nero_3D - 08.02.2009, 00:53
Re: little question - by nesty - 09.02.2009, 14:21
Re: little question - by nesty - 09.02.2009, 20:51
Re: little question - by Eraz0r - 09.02.2009, 20:53
Re: little question - by nesty - 09.02.2009, 20:55
Re: little question - by nesty - 09.02.2009, 21:16
Re: little question - by ICECOLDKILLAK8 - 09.02.2009, 21:32
Re: little question - by Eraz0r - 09.02.2009, 21:52
Re: little question - by nesty - 09.02.2009, 22:03
Re: little question - by Eraz0r - 09.02.2009, 22:05
Re: little question - by nesty - 09.02.2009, 22:22
Re: little question - by Auto-Sized - 10.02.2009, 02:32
Re: little question - by nesty - 11.02.2009, 15:51
Re: little question - by Auto-Sized - 11.02.2009, 22:13
Re: little question - by nesty - 13.02.2009, 19:42
Re: little question - by Nero_3D - 13.02.2009, 20:31
Re: little question - by nesty - 14.02.2009, 16:40

Forum Jump:


Users browsing this thread: 1 Guest(s)