Soren Posted January 2, 2012 Share Posted January 2, 2012 hey all i made a script thats give's you a weapon in a DD function Markerhit (hitPlayer, matchingDimension) outputChatBox ( getPlayerName(hitPlayer) .. "Get a Combat Shotgun!! RUN!!" ) giveWeapon ( source, 27, 21 ) setPedDoingGangDriveby ( getLocalPlayer (), true ) end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) it has a error but i dont know where!! help me the script should make this -when hit the marker say -Palyertthathitthemarke get a Convat Shothgun RUN!! -Give's you a Spaz-12 whit 21 of ammo -make gangdriveby pls help me Link to comment
Kenix Posted January 2, 2012 Share Posted January 2, 2012 (edited) Client side: function Markerhit ( hitPlayer, matchingDimension ) outputChatBox ( getPlayerName( hitPlayer ) .. "Get a Combat Shotgun!! RUN!!" ) triggerServerEvent( "giveWeapon",hitPlayer ) setPedDoingGangDriveby ( hitPlayer, true ) end addEventHandler ( "onClientMarkerHit", root, MarkerHit ) Server side: addEvent( "giveWeapon",true) addEventHandler( "giveWeapon",root, function( ) giveWeapon ( source, 27, 21 ) end ) giveWeapon is server side function. https://wiki.multitheftauto.com/wiki/Scr ... troduction Edited January 2, 2012 by Guest Link to comment
Soren Posted January 2, 2012 Author Share Posted January 2, 2012 Client: function Markerhit ( hitPlayer, matchingDimension ) outputChatBox ( getPlayerName( hitPlayer ) .. "Get a Combat Shotgun!! RUN!!" ) triggerServerEvent( "giveWeapon",hitPlayer ) setPedDoingGangDriveby ( hitPlayer, true ) end addEventHandler ( "onClientMarkerHit", root, MarkerHit ) Server: addEvent( "giveWeapon",true) addEventHandler( "giveWeapon",root, function( ) giveWeapon ( source, 27, 21 ) end ) giveWeapon is server side function. i dont undersant what do you mean man i have like 2 day's scripting pls explain me function Markerhit ( hitPlayer, matchingDimension ) outputChatBox ( getPlayerName( hitPlayer ) .. "Get a Combat Shotgun!! RUN!!" ) triggerServerEvent( "giveWeapon",hitPlayer ) setPedDoingGangDriveby ( hitPlayer, true ) addEvent( "giveWeapon",true) addEventHandler( "giveWeapon",root, function( ) giveWeapon ( source, 27, 21 ) end ) end addEventHandler ( "onClientMarkerHit", root, MarkerHit ) Link to comment
Kenix Posted January 2, 2012 Share Posted January 2, 2012 Please read my post better. Link to comment
Soren Posted January 2, 2012 Author Share Posted January 2, 2012 Please read my post better. so i only need to put it like this? function Markerhit ( hitPlayer, matchingDimension ) outputChatBox ( getPlayerName( hitPlayer ) .. "Get a Combat Shotgun!! RUN!!" ) triggerServerEvent( "giveWeapon",hitPlayer ) setPedDoingGangDriveby ( hitPlayer, true ) end addEventHandler ( "onClientMarkerHit", root, MarkerHit ) Link to comment
Kenix Posted January 2, 2012 Share Posted January 2, 2012 Read https://wiki.multitheftauto.com/wiki/Scr ... troduction Link to comment
Soren Posted January 2, 2012 Author Share Posted January 2, 2012 Read https://wiki.multitheftauto.com/wiki/Scr ... troduction i sorrender Link to comment
Kenix Posted January 2, 2012 Share Posted January 2, 2012 What? I not understand you. Link to comment
Castillo Posted January 2, 2012 Share Posted January 2, 2012 He said: I surrender . -- client side: function Markerhit ( hitPlayer, matchingDimension ) outputChatBox ( getPlayerName( hitPlayer ) .. "Get a Combat Shotgun!! RUN!!" ) triggerServerEvent( "giveWeapon",hitPlayer ) setPedDoingGangDriveby ( hitPlayer, true ) end addEventHandler ( "onClientMarkerHit", root, MarkerHit ) -- server side: addEvent( "giveWeapon",true) addEventHandler( "giveWeapon",root, function( ) giveWeapon ( source, 27, 21 ) end ) Now you must create a meta.xml and two Lua files: client and server.lua, read about meta.xml here: https://wiki.multitheftauto.com/wiki/Meta.xml Link to comment
Soren Posted January 7, 2012 Author Share Posted January 7, 2012 He said: I surrender .-- client side: function Markerhit ( hitPlayer, matchingDimension ) outputChatBox ( getPlayerName( hitPlayer ) .. "Get a Combat Shotgun!! RUN!!" ) triggerServerEvent( "giveWeapon",hitPlayer ) setPedDoingGangDriveby ( hitPlayer, true ) end addEventHandler ( "onClientMarkerHit", root, MarkerHit ) -- server side: addEvent( "giveWeapon",true) addEventHandler( "giveWeapon",root, function( ) giveWeapon ( source, 27, 21 ) end ) Now you must create a meta.xml and two Lua files: client and server.lua, read about meta.xml here: https://wiki.multitheftauto.com/wiki/Meta.xml But its for a DD map it will work if i put both in the meta.xml? Link to comment
Soren Posted January 8, 2012 Author Share Posted January 8, 2012 Yes, it'll work too. it does not work if i put the Ids at the start of the script? Link to comment
Castillo Posted January 8, 2012 Share Posted January 8, 2012 What do you mean? and what doesn't work? Link to comment
Xeno Posted January 8, 2012 Share Posted January 8, 2012 Meta: meta> <info author="" version="1" type="script" name="" description="" /> <script src="client.lua" type="client" /> <script src="server.lua" type="server" /> </meta> Put this in server.lua : addEvent( "giveWeapon",true) addEventHandler( "giveWeapon",root, function( ) giveWeapon ( source, 27, 21 ) end ) And put this in client.lua : function Markerhit ( hitPlayer, matchingDimension ) outputChatBox ( getPlayerName( hitPlayer ) .. "Get a Combat Shotgun!! RUN!!" ) triggerServerEvent( "giveWeapon",hitPlayer ) setPedDoingGangDriveby ( hitPlayer, true ) end addEventHandler ( "onClientMarkerHit", root, MarkerHit ) PS. IF YOU READ THE TUTORIALS, YOU WILL UNDERRRSTANNNNDD 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