DSC-L|Gr00vE[Ger] Posted February 21, 2008 Share Posted February 21, 2008 Hey everyone, i´ve got another request : is it possible to have these $ - pickups like in gta : sa singleplayer in mta ? ... that when a player dies he drops a $ - pickup with all his money in it. and when someone else pick it up he will get this money ...^^ so, is it possible and could somebody please try to make it for me ? ps: it would be nice, if the pickup will be the same like in gta sp ^^ THX Gr00vE Link to comment
XetaQuake Posted February 21, 2008 Share Posted February 21, 2008 yea pleas, it would be great when the player also drop the weapons! Link to comment
Jumba' Posted February 24, 2008 Share Posted February 24, 2008 Anyone know the id for the money pickup? Cause I can't find it. Link to comment
XetaQuake Posted February 24, 2008 Share Posted February 24, 2008 make you a public release? ID: 1212 i have found the ID with google, i have not testing it Link to comment
iam2noob4u Posted February 26, 2008 Share Posted February 26, 2008 try function createMoney(mx,my,mz,level) local x1=(mx-2)+(math.random()*4) local y1=(my-2)+(math.random()*4) local x2=(mx-2)+(math.random()*4) local y2=(my-2)+(math.random()*4) local moneyamount=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) setElementData(createPickup(x2,y2,mz,3,1212),"amount",moneyamount) end and function pickup(player) local money=getElementData(source,"amount") if ( money ) then givePlayerMoney(player,money) destroyElement(source) end end addEventHandler("onPickupUse",root,pickup) and function playerWasted ( ammo, attacker, weapon, bodypart ) local px,py,pz = getElementPosition(source) createMoney(px,py,pz,getElementData(source,"level")) --The last argument should be changed. Unless you have levels on your server (that are stored this way). end addEventHandler ( "onPlayerWasted", root, playerWasted ) Link to comment
Jammie Posted February 4, 2010 Share Posted February 4, 2010 I have the uppest script and that works great! only not all my money... can someone helps me to drop all the money..! Link to comment
robhol Posted February 4, 2010 Share Posted February 4, 2010 I have the uppest script and that works great! only not all my money... can someone helps me to drop all the money..! Please tell me and be honest: did you even try thinking for a whole 10 seconds before giving up and asking? Link to comment
Dark Dragon Posted February 4, 2010 Share Posted February 4, 2010 for weapons drops simply start the deathpickups resource Link to comment
DutchCaffeine Posted February 5, 2010 Share Posted February 5, 2010 Jammie: I give you one tip about the ammount of the money pickup, it is in one of these three lines. And by the way, next time you will need your glasses in other to read the script. local y2=(my-2)+(math.random()*4) local moneyamount=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) Link to comment
Jammie Posted February 5, 2010 Share Posted February 5, 2010 Hey Alexander, do you know jim & wappie? about the script, I have try to fill in a value but nothing changed. local y2=(my-2)+(math.random()*4) local moneyamount=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) Maybe 3,1212 or amount or (200*level^0.2) I think these 3 are the amount what you drop.. Link to comment
DutchCaffeine Posted February 5, 2010 Share Posted February 5, 2010 Hey Alexander, do you know jim & wappie? about the script, I have try to fill in a value but nothing changed. local y2=(my-2)+(math.random()*4) local moneyamount=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) Maybe 3,1212 or amount or (200*level^0.2) I think these 3 are the amount what you drop.. Today's reclame: goto hans anders for glasses! I said, it is one of the 3 lines that tells you wich makes the ammount of money. local moneyammount = math.floor(200*level^0.2) Now if you change moneyammount to getPlayerMoney then you've got it! Simple he? Yes, i know jim and wappie. Link to comment
Jammie Posted February 7, 2010 Share Posted February 7, 2010 Alexander, it doens't work. Maybe we need both glasses of Hans anders I have this now but the same effect: function createMoney(mx,my,mz,level) local x1=(mx-2)+(math.random()*4) local y1=(my-2)+(math.random()*4) local x2=(mx-2)+(math.random()*4) local y2=(my-2)+(math.random()*4) local getPlayerMoney=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) setElementData(createPickup(x2,y2,mz,3,1212),"amount",moneyamount) end And I have try this: function createMoney(mx,my,mz,level) local x1=(mx-2)+(math.random()*4) local y1=(my-2)+(math.random()*4) local x2=(mx-2)+(math.random()*4) local y2=(my-2)+(math.random()*4) local getPlayerMoney=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",getPlayerMoney) setElementData(createPickup(x2,y2,mz,3,1212),"amount",getPlayerMoney) end But the same effect... Link to comment
DutchCaffeine Posted February 7, 2010 Share Posted February 7, 2010 Here, this is the complete script. And really learn the basic of lua scripting! function createMoney(player) local x, y, z = getElementPosition(player); local x1, y1, x2, y2; x1 = (x-2)+(math.random()*4); y1 = (y-2)+(math.random()*4); x2 = (x-2)+(math.random()*4); y2 = (y-2)+(math.random()*4); local moneyAmmount = getPlayerMoney(player); -- it is not fair too get all the player money. moneyAmmount = math.floor(moneyAmmount/3); takePlayerMoney(player, moneyAmmount); -- We are going to create 2 pickups, zo we are just cut the ammount in half moneyAmmount = math.floor(moneyAmmount/2); -- Create the pickups setElementData(createPickup(x1, y1, z, 3, 1212), "ammount", moneyAmmount)); setElementData(createPickup(x2, y2, z, 3, 1212), "ammount", moneyAmmount)); end function moneyPickupHit(player) local money = getElementData(source, "ammount"); if money then givePlayerMoney(player, money); destroyElement(source); end end function playerJustGotDied(ammo, attacker, weapon, bodypart) createMoney(source); end addEventHandler("onPickupUse", getRootElement(), moneyPickupHit); addEventHandler("onPlayerWasted", getRootElement(), playerJustGotDied); Link to comment
Jammie Posted February 7, 2010 Share Posted February 7, 2010 Thanks Alexander, I have put this script on the same place: server side but now he drops nothing anymore... its very strange.. Link to comment
Castillo Posted February 12, 2010 Share Posted February 12, 2010 hi, i fixed that bug and im sending it to you jammie Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now