Jump to content

Working?


SolidJuho

Recommended Posts

Posted

Does this script work?

addCommandHandler( "wantedoff", getRootElement( ) 
    function ( ) 
        setElementData( source, "wantedlevelB4death", getPlayerWantedLevel( source ), false ); 
        local wantedlevel = getElementData( source, "wantedlevelB4death" ); 
        takePlayerMoney ( 5000 )         
        if wantedlevel and wantedlevel > 0 then 
            setPlayerWantedLevel( source, wantedlevel ); 
            end 
        end 
     end 
) 

Please help.

Posted

No.

  
addCommandHandler( "wantedoff", 
    function ( ) 
        setElementData( source, "wantedlevelB4death", getPlayerWantedLevel( source ), false ); 
        local wantedlevel = getElementData( source, "wantedlevelB4death" ); 
        takePlayerMoney ( 5000 )         
        if wantedlevel > 0 then 
            setPlayerWantedLevel( source, wantedlevel ); 
            end 
        end 
     end 
) 
  

  • Moderators
Posted

addCommandHandler doesn't have a source, how does it suppose to work....

The player should be the localPlayer on clientside or the first parameter at serverside.

Also serverside functions and clientside functions are mixed up in the code.

  • Moderators
Posted (edited)
Also serverside functions and clientside functions are mixed up in the code.

There is no client-side only functions in this code o_O

OFF-TOPIC: 300 Posts ! HURRAY!

Myeah but half are just working solutions. And here is again a not working solution.

Read carefully the code when you want to help someone. There is not only one problem most of the time.

addCommandHandler( "wantedoff", function ( thePlayer ) 
    setElementData( thePlayer, "wantedlevelB4death", getPlayerWantedLevel( thePlayer ), false ) 
    local wantedlevel = getElementData( thePlayer, "wantedlevelB4death" ) 
    takePlayerMoney ( thePlayer, 5000 )         
    if wantedlevel > 0 then 
        setPlayerWantedLevel( thePlayer, wantedlevel ) 
    end 
 end) 

By the way, I just fixed the syntax. Can you explain what did you want to do with this command ??

Edited by Guest
  • Moderators
Posted

True. But I meant what arguments that can be used inside the functions, which make the differences between serverside and clientside.

Like this one:

takePlayerMoney ( 5000 )  
  
takePlayerMoney (thePlayer, 5000 ) 

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