Jump to content

takeWeapon onPlayerMarkerHit


Thivenin

Recommended Posts

hai all

I wanted to do : when a player pass the marker "outOneVSOneMarkertoPrincipalInterior" his melee weapon got removed

but it's not removing and it's not giving any error message

here the script

function removeOneVSOneWeapon ( markerhit, takeweapon ) 
    if ( markerHit == outOneVSOneMarkertoPrincipalInterior ) then 
        takeWeapon ( thePlayer, 2 ) 
        takeWeapon ( thePlayer, 4 ) 
        takeWeapon ( thePlayer, 5 ) 
        takeWeapon ( thePlayer, 6 )  
        takeWeapon ( thePlayer, 8 ) 
        takeWeapon ( thePlayer, 9 ) 
        takeWeapon ( thePlayer, 10 ) 
    end 
end 
addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) 

the createMarker "outOneVSOneMarkertoPrincipalInterior " is more up on the script page (there is 202 line so I won't give you all the script if everything is working except this part) and I didn't remove other melee weapon cus on the script there is only "pickup" these weapon

help me pls if you have time ^^

Link to comment
function removeOneVSOneWeapon ( markerhit, matchingDimension ) 
    if ( markerhit == outOneVSOneMarkertoPrincipalInterior ) then 
        takeWeapon ( thePlayer, 2 ) 
        takeWeapon ( thePlayer, 4 ) 
        takeWeapon ( thePlayer, 5 ) 
        takeWeapon ( thePlayer, 6 ) 
        takeWeapon ( thePlayer, 8 ) 
        takeWeapon ( thePlayer, 9 ) 
        takeWeapon ( thePlayer, 10 ) 
    end 
end 
addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) 

You've defined markerhit, but you used makerHit

Link to comment
function removeOneVSOneWeapon ( markerhit, matchingDimension ) 
    if ( markerhit == outOneVSOneMarkertoPrincipalInterior ) then 
        takeWeapon ( source, 2 ) 
        takeWeapon ( source, 4 ) 
        takeWeapon ( source, 5 ) 
        takeWeapon ( source, 6 ) 
        takeWeapon ( source, 8 ) 
        takeWeapon ( source, 9 ) 
        takeWeapon ( source, 10 ) 
    end 
end 
addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) 

try like this :D

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