Need a little help with this please ! :)
#7

pawn Код:
new moneypickup[MAX_PICKUPS][2] = {-1, -1, ...};
public OnPlayerDeath(playerid, killerid, reason)
{
  new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);

  new pickup = CreatePickup(1550, 23, pos[0], pos[1], pos[2]); //Might fuck around a bit with the '23'
  moneypickup[pickup][0] = GetPlayerMoney(playerid); //The player loses all his money. Change this to whatever value the pickup must contain.
  ResetPlayerMoney(playerid); //Resets the player's money, use GivePlayerMoney(playerid, -amount) to remove a specific amount.
  moneypickup[p][1] = SetTimerEx("DeletePickupEx", 5*1000, 0, "d", pickup);
  return 1;
}

forward DeletePickupEx(pickupid);
public DeletePickupEx(pickupid)
{
  DestroyPickup(pickupid);
  moneypickup[pickupid][0] = -1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
  for(new p; p < MAX_PICKUPS; p++)
  {
    if(moneypickup[p][0] != -1)
    {
      KillTimer(moneypickup[p][1]);
      GivePlayerMoney(playerid, moneypickup[p][0]);
      DestroyPickup(p);
    }
  }
  return 1;
}
Didn't tested anything, and the typing box is a li'l small (Quick reply). Hope it works.
Reply


Messages In This Thread
Need a little help with this please ! :) - by Matej_ - 05.09.2010, 09:18
Re: Need a little help with this please ! :) - by LOLlolLOL - 05.09.2010, 09:26
Re: Need a little help with this please ! :) - by Matej_ - 05.09.2010, 09:32
Re: Need a little help with this please ! :) - by Ironboy500[TW] - 05.09.2010, 09:38
Re: Need a little help with this please ! :) - by Matej_ - 05.09.2010, 09:40
Re: Need a little help with this please ! :) - by Matej_ - 05.09.2010, 14:03
Re: Need a little help with this please ! :) - by Hiddos - 05.09.2010, 14:19
Re: Need a little help with this please ! :) - by Matej_ - 05.09.2010, 14:40
Re: Need a little help with this please ! :) - by Hiddos - 05.09.2010, 14:57
Re: Need a little help with this please ! :) - by Matej_ - 06.09.2010, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)