_iLustcheR_

SAMP-IL DeathPickup v1.0 by LustcheR

Aug 25th, 2013
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.17 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. enum MoneyInfo
  4. {
  5.     PickupMoney,
  6.     MathMoney,
  7.     Text3D:TextMoney
  8. };
  9. new xMoney[MoneyInfo];
  10.  
  11. public OnPlayerDeath(playerid, killerid, reason)
  12. {
  13.     new Float:Pos[3], String[25];
  14.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  15.     xMoney[MathMoney] = GetPlayerMoney(playerid);
  16.     xMoney[PickupMoney] = CreatePickup(1212, 1, Pos[0], Pos[1], Pos[2], 0);
  17.     format(String, sizeof(String), "Monay: %s", GetNum(xMoney[MathMoney]));
  18.     xMoney[TextMoney] = Create3DTextLabel(String, 0xFFFF00AA, Pos[0], Pos[1], Pos[2], 40.0, 0, 0);
  19.     return 1;
  20. }
  21.  
  22. public OnPlayerPickUpPickup(playerid, pickupid)
  23. {
  24.     if(pickupid == xMoney[PickupMoney]) return GivePlayerMoney(playerid, xMoney[MathMoney]), DestroyPickup(xMoney[PickupMoney]), Delete3DTextLabel(xMoney[TextMoney]);
  25.     return 1;
  26. }
  27.  
  28. stock GetNum(Num)
  29. {
  30.     new sMoney[13];
  31.     format(sMoney,sizeof(sMoney),"%d",Num);
  32.     if(strlen(sMoney) < 4) return sMoney;
  33.     new iPos = strlen(sMoney), iCount = 1;
  34.     while(iPos > 0)
  35.     {
  36.         if(iCount == 4)
  37.         {
  38.             iCount = 0;
  39.             strins(sMoney,",",iPos,1);
  40.             iPos ++;
  41.         }
  42.         iCount ++;
  43.         iPos --;
  44.     }
  45.     return sMoney;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment