abod99119911 Posted August 9, 2014 Share Posted August 9, 2014 hi guyz. this is script which is to make marker and when player get in the will get full health and armor but i want to add gun:M4 with ammo local team = createTeam ( "TeamName", 0, 255, 0 ) local theMarker = createMarker ( x, y, z, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler("onMarkerHit", theMarker, function (thePlayer) if ( getElementType ( thePlayer ) == 'player' ) then if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer ) ) == 'TeamName' ) then setElementHealth ( thePlayer, 100 ) setPedArmor ( thePlayer, 100 ) end end end ) and here i can add the X, Y, Z for where the marker will be ? local theMarker = createMarker ( x, y, z, "cylinder", 1.5, 255, 255, 0, 170 ) Link to comment
Et-win Posted August 9, 2014 Share Posted August 9, 2014 giveWeapon And yes, you can do that by doing this: local x, y, z = 1, 2, 3 createMarker --Or: createMarker(1, 2, 3, ... Link to comment
abod99119911 Posted August 9, 2014 Author Share Posted August 9, 2014 giveWeapon to add M4 ? Link to comment
Et-win Posted August 9, 2014 Share Posted August 9, 2014 Yup. Click on the code and read the wiki. Find the gun list, and there you will find the ID's of weapons, with M4 in it too. Link to comment
abod99119911 Posted August 10, 2014 Author Share Posted August 10, 2014 see what i do but its not working i put the marker location where is the wrong Link to comment
Anubhav Posted August 10, 2014 Share Posted August 10, 2014 (edited) local team = createTeam ( "TeamName", 0, 255, 0 ) local theMarker = createMarker ( -711.68450927734, 957.69964599609, 12.388543128967, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler("onMarkerHit", theMarker, function (thePlayer) if ( getElementType ( thePlayer ) == 'player' ) then if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer ) ) == 'TeamName' ) then setElementHealth ( thePlayer, 100 ) setPedArmor ( thePlayer, 100 ) giveWeapon ( thePlayer, 31, 2000 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) end end ) Edited August 10, 2014 by Guest Link to comment
Et-win Posted August 10, 2014 Share Posted August 10, 2014 Event: onMarkerHit "The source of this event is the marker that got hit by the element." Link to comment
TAPL Posted August 10, 2014 Share Posted August 10, 2014 I don't understand why this line is here? addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) And you trying to give weapon to marker? The marker have no hand to carry the gun. giveWeapon ( source, 31, 2000 ) Link to comment
abod99119911 Posted August 10, 2014 Author Share Posted August 10, 2014 I don't understand why this line is here? addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) i found it on wiki 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