Jump to content

what's wrong?


Sparrow

Recommended Posts

now I do script that remove 1 star when I type /rstar but it didn't remove this star, this what I do:

function removeMyStar(thePlayer) 
    local wanted = getPlayerWantedLevel (thePlayer) 
    if (wanted = 1) then 
        local getMoney = getPlayerMoney (thePlayer) 
        if (getMoney == 250) then 
            setPlayerWantedLevel (thePlayer, 0) 
            outputChatBox ("You have removed your star for $250.", thePlayer, 0, 255, 0) 
        else 
            outputChatBox ("You need $250 to remove your star.", thePlayer, 255, 0, 0) 
        end 
    end 
end 
addCommandHandler ("rstar", removeMyStar) 

Link to comment
  
addCommandHandler( "removeStars", 
function( thePlayer, cmd ) 
local stars = getPlayerWantedLevel( thePlayer ) 
local money = getPlayerMoney( thePlayer ) 
if ( stars == 1 ) then 
if ( money >= 100 ) then 
     setPlayerWantedLevel( thePlayer, stars - 1 ) 
else 
      outputChatBox( "you need more cash!", thePlayer ) 
          end 
      end 
end ) 

Link to comment
function removeMyStar( thePlayer, cmd ) 
    local wanted = getPlayerWantedLevel ( thePlayer ) 
    local getMoney = getPlayerMoney ( thePlayer ) 
    local setlevel = setPlayerWantedLevel ( thePlayer ) 
    if ( wanted ~= 1 and getMoney == 250 ) then 
        takePlayerMoney ( thePlayer, 250 ) 
        setPlayerWantedLevel ( thePlayer, setlevel-1 ) 
        outputChatBox ("You have removed your star for $250.", thePlayer, 0, 255, 0) 
    else 
        outputChatBox ("You need $250 to remove your star.", thePlayer, 255, 0, 0) 
    end 
end 
addCommandHandler ("rstar", removeMyStar) 

Link to comment
function removeMyStar( thePlayer, cmd ) 
    local wanted = getPlayerWantedLevel ( thePlayer ) 
    local getMoney = getPlayerMoney ( thePlayer ) 
    if ( wanted ~= 1 and getMoney == 250 ) then 
        takePlayerMoney ( thePlayer, 250 ) 
        setPlayerWantedLevel ( thePlayer, wanted - 1 ) 
        outputChatBox ("You have removed your star for $250.", thePlayer, 0, 255, 0) 
    else 
        outputChatBox ("You need $250 to remove your star.", thePlayer, 255, 0, 0) 
    end 
end 
addCommandHandler ("rstar", removeMyStar) 

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