Bag money - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bag money (
/showthread.php?tid=486559)
Bag money -
MahdiGames - 09.01.2014
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.
Re: Bag money -
offon - 09.01.2014
Код:
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.
Re: Bag money -
greentarch - 09.01.2014
Use this filterscript (not mine)
https://sampforum.blast.hk/showthread.php?tid=449321
Re: Bag money -
MahdiGames - 09.01.2014
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??
Re: Bag money -
offon - 09.01.2014
Try to run the code, it should work if you did everything well.
Re: Bag money -
MahdiGames - 09.01.2014
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.
Re: Bag money -
offon - 09.01.2014
Change BAG_ID to the object ID of the money bag (you can find object IDs at the Wiki (
https://sampwiki.blast.hk/)).
Re: Bag money -
MahdiGames - 09.01.2014
But its not working what is the position of the pickup? Same of playerid?
Re: Bag money -
offon - 09.01.2014
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?