Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- enum MoneyInfo
- {
- PickupMoney,
- MathMoney,
- Text3D:TextMoney
- };
- new xMoney[MoneyInfo];
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new Float:Pos[3], String[25];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- xMoney[MathMoney] = GetPlayerMoney(playerid);
- xMoney[PickupMoney] = CreatePickup(1212, 1, Pos[0], Pos[1], Pos[2], 0);
- format(String, sizeof(String), "Monay: %s", GetNum(xMoney[MathMoney]));
- xMoney[TextMoney] = Create3DTextLabel(String, 0xFFFF00AA, Pos[0], Pos[1], Pos[2], 40.0, 0, 0);
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == xMoney[PickupMoney]) return GivePlayerMoney(playerid, xMoney[MathMoney]), DestroyPickup(xMoney[PickupMoney]), Delete3DTextLabel(xMoney[TextMoney]);
- return 1;
- }
- stock GetNum(Num)
- {
- new sMoney[13];
- format(sMoney,sizeof(sMoney),"%d",Num);
- if(strlen(sMoney) < 4) return sMoney;
- new iPos = strlen(sMoney), iCount = 1;
- while(iPos > 0)
- {
- if(iCount == 4)
- {
- iCount = 0;
- strins(sMoney,",",iPos,1);
- iPos ++;
- }
- iCount ++;
- iPos --;
- }
- return sMoney;
- }
Advertisement
Add Comment
Please, Sign In to add comment