Bag money
#1

Hello, how to create bag money when someone the playerid got killed by killer like pickup it and get 1000$? iv tried some scripts such as Weapon Drop fs but it only drops the weapons , thanks.
Reply
#2

Код:
new money;

public OnPlayerDeath(playerid, killerid, reason) 
{
     new Float:x, Float:y, Float:z;
     GetPlayerPos(playerid, x, y, z);
     money = CreatePickup(BAG_ID, 4, x+1.5, y, z, 0);
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
     if(pickupid == money) GivePlayerMoney(playerid, AMOUNT_OF_MONEY);
}
Ofcourse you have to make changes.
Reply
#3

Use this filterscript (not mine)
https://sampforum.blast.hk/showthread.php?tid=449321
Reply
#4

Quote:
Originally Posted by offon
Посмотреть сообщение
Код:
new money;

public OnPlayerDeath(playerid, killerid, reason) 
{
     new Float:x, Float:y, Float:z;
     GetPlayerPos(playerid, x, y, z);
     money = CreatePickup(BAG_ID, 4, x+1.5, y, z, 0);
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
     if(pickupid == money) GivePlayerMoney(playerid, AMOUNT_OF_MONEY);
}
Ofcourse you have to make changes.
This is working??
Reply
#5

Try to run the code, it should work if you did everything well.
Reply
#6

C:\Users\MaHdy\Desktop\SPATest\gamemodes\SPA.pwn(3 024) : error 017: undefined symbol "BAG_ID"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Change BAG_ID to the object ID of the money bag (you can find object IDs at the Wiki (https://sampwiki.blast.hk/)).
Reply
#8

But its not working what is the position of the pickup? Same of playerid?
Reply
#9

No. I've already created the pickup. You need to get the position of the player's death, I did that with GetPlayerPos(); You only need to BAG_ID to the object ID of the money bag and AMOUNT_OF_MONEY to how much you want to be dropper (example: $1000).

Do you get any errors?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)