Jump to content

Command account


BorderLine

Recommended Posts

Hi forum :)

Well i was trying to make this script

this is about respawn my own car with a command, but just i want do this command, no other players

so i did this

  
function yakuza() 
    local account = getPlayerAccount ( thePlayer ) 
if account == "yakuza" then 
        outputChatBox ( "You cant make this use", thePlayer, 255, 200, 0 ) 
else 
respawnVehicle ( vehicle1 ) 
    end 
end 
addCommandHandler("respawnmycar", yakuza) 
  

its a server side

thx

Link to comment

You did it the wrong way around ;3

function yakuza() 
    local account = getPlayerAccount ( thePlayer ) 
if account == "yakuza" then 
respawnVehicle ( vehicle1 ) 
    
else 
        outputChatBox ( "You cant make this use", thePlayer, 255, 200, 0 ) 
    end 
end 
addCommandHandler("respawnmycar", yakuza) 

Link to comment
function yakuza(thePlayer) 
    local account = getPlayerAccount ( thePlayer ) 
if not isGuestAccount(account) and getAccountName(account) == "yakuza" then 
respawnVehicle ( vehicle1 ) 
else 
        outputChatBox ( "You cant make this use", thePlayer, 255, 200, 0 ) 
    end 
end 
addCommandHandler("respawnmycar", yakuza) 

Is vehicle1 a global variable?

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