Soren Posted November 18, 2011 Share Posted November 18, 2011 Hi all im serching a script that when you touch a merker you get a weapon to destroy other people like in the map Puma - Circle circles I have this script but it does not work ids = { "Marker (corona)(1)", "Marker (corona)(2)" } addEventHandler ( "onMarkerHit" ,getResourceRootElement ( ), function ( element ) if ids[getElementID ( source )] and getElementType ( element ) == "player" then giveWeapon ( element, 38, 500, true ) setPedDoingGangDriveBy ( element, true ) end end ) I want to know if the script it's ok and if not you can send me the good one pls If its ok ple send me a pm telling me how to install it on the map Atte: iSoren Link to comment
CapY Posted November 19, 2011 Share Posted November 19, 2011 (edited) https://wiki.multitheftauto.com/wiki/CreateMarker https://wiki.multitheftauto.com/wiki/GiveWeapon https://wiki.multitheftauto.com/wiki/Set ... angDriveby https://wiki.multitheftauto.com/wiki/OnMarkerHit Make it from a scratch again, read the function arguments. local marker1 = createMarker(x, y,z , "type", size, r, g, b...) local marker2 = createMarker(x, y,z , "type", size, r, g, b...) function blah () giveWeapon ( source, weaponId, ammo ) setPedDoingGangDriveby ( source, true ) end addEventHandler ( "onMarkerHit" , marker1, blah) addEventHandler ( "onMarkerHit" , marker2, blah) Something like that... Edited November 20, 2011 by Guest Link to comment
Castillo Posted November 19, 2011 Share Posted November 19, 2011 ids = { ["Marker (corona)(1)"] = true, ["Marker (corona)(2)"] = true } addEventHandler ( "onMarkerHit",root, function ( element ) if getElementID ( source ) and ids[getElementID ( source )] and getElementType ( element ) == "player" then giveWeapon ( element, 38, 500, true ) setPedDoingGangDriveby ( element, true ) end end ) P.S: CapY, please don't talk like that, you keep doing everything wrong, you can't really tell him to read the arguments if you don't. Link to comment
Soren Posted November 20, 2011 Author Share Posted November 20, 2011 https://wiki.multitheftauto.com/wiki/CreateMarkerhttps://wiki.multitheftauto.com/wiki/GiveWeapon https://wiki.multitheftauto.com/wiki/Set ... angDriveby https://wiki.multitheftauto.com/wiki/OnMarkerHit Make it from a scratch again, read the function arguments. local marker1 = createMarker(x, y,z , "type", size, r, g, b...) local marker2 = createMarker(x, y,z , "type", size, r, g, b...) function blah () giveWeapon ( source, weaponId, ammo ) setPedDoingGangDriveBy ( source, true ) end addEventHandler ( "onMarkerHit" , marker1, blah) addEventHandler ( "onMarkerHit" , marker2, blah) Something like that... Thx it works Link to comment
CapY Posted November 20, 2011 Share Posted November 20, 2011 No problem. P.S. See Castillo, i did. Link to comment
Castillo Posted November 20, 2011 Share Posted November 20, 2011 That will never work, setPedDoingGangDriveBy is wrong, it should be: setPedDoingGangDriveby . Link to comment
CapY Posted November 20, 2011 Share Posted November 20, 2011 And now, it is. Soren copy my code again. 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