Jump to content

HELPP!!


Soren

Recommended Posts

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

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 by Guest
Link to comment
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
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

He said: I surrender :P.

-- 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
He said: I surrender :P.

-- 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...