50p Posted September 22, 2008 Share Posted September 22, 2008 Well, you can call moveObject function. But before you change your code, do you get any errors when you leave the colshape or does it actually get triggered? Debug the script, http://development.mtasa.com/index.php?title=Debugging Link to comment
jkub Posted September 22, 2008 Author Share Posted September 22, 2008 It doesent give an error but it dont move it back either? Link to comment
50p Posted September 22, 2008 Share Posted September 22, 2008 Try debugging (add some outputChatBox, outputDebugString, etc. in gateClose). Link to comment
jkub Posted September 28, 2008 Author Share Posted September 28, 2008 I want it to where you shoot someone in there head and you get $1000 dollars. but any other limbs you only get $250 but instead this gives you the combined $1250 anywhere you kill someone? function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) --if there is a killer, and that killer is not the same person as whoever died if ( killer ) and ( killer ~= source ) then givePlayerMoney ( killer, 250 ) --reward the killer with 1000 cash. if ( bodypart ) and ( bodypart ~= "9" ) then givePlayerMoney ( killer, 1000 ) end end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) --attach the rewardOnWasted function to the relevant event. Link to comment
50p Posted September 30, 2008 Share Posted September 30, 2008 In your code: 1. You give killer money if somebody dies not getting hit 2. You give $1000 if player was not killed in the head 3. You give $250 if player is killed That's why you get $1250 when you kill somebody. Try this one: addEventHandler( "onPlayerDamage", getRootElement(), function( attaker, weap, bodypart ) -- attach an anonymous function if attacker and getElementType( attacker ) == "player" then -- check if attacker is player if bodypart == 9 then -- if player hit your head, give him 1000 givePlayerMoney( attacker, 1000 ) else -- if any other part, just give him 250 givePlayerMoney( attacker, 250 ) end end end ) Link to comment
jkub Posted October 10, 2008 Author Share Posted October 10, 2008 I have had multiple request to get some kind of jailing system in my server. but i guess it could be somthing simple. like I make an enclosed space somewhere in the map with my map editor and when ur arrested have the criminal be warped into the space and able not to use any functions for 1 minute. he will not be able to do any freeroam commands. after that 1 minute is up he is released back at the regular spawn point of the server with all of his functions enabled again. anyway the way of arresting should be 1 hitting the player with a nightstick ONCE 2 as a alternative to the first way>>> via admin only command I remember seeing someone with a script similir on the forum. Link to comment
Gamesnert Posted October 10, 2008 Share Posted October 10, 2008 onPlayerDamage might be a good choice for the nightstick. You just have a function which puts him in jail, and add an event handler and command handler. The command handler needs to be protected, but hasObjectPermissionTo will help you there! It shouldn't be that hard to make a basic jail knowing this. Link to comment
Beethoven Posted January 9, 2009 Share Posted January 9, 2009 Can someone post a script for me that: have two markers if u touch one of them, you will go to the other one. in a car too. im not that good with scripting, soifyou post a script, please conplete thank you, beethoven Link to comment
Beethoven Posted January 13, 2009 Share Posted January 13, 2009 Solved.... For The ones that need it, ad two lines in interior.map, interior resource 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