Jump to content

[Problem] Skin Cop for Vehicle


Jumper_Mych

Recommended Posts

1.

omfg! you are doing random code as i said, this makes no sense o_o, you want to setPlayerName in a vehicle??

I try change to setPlayerFromNick is doesn't work i change next setPlayerType but doesn't work it all doesn't work, unless my code are error

2.simply ask you, i want Vehicle is owned Jumper_Mych :P

Link to comment

what are you trying to do? i would recommend doing something like this:

vehicle = createVehicle ( 496, 2425, -55, 27, 0, 0, 0 ) 
setElementData(vehicle,"vehicle","car") 
setElementData(vehicle, "owner", "Jumper_Mych") 
  
function enterVehicle ( player, seat, jacked ) 
    if (getElementData(source, "vehicle" ) == "car") and ( not getElementData(source, "owner" ) == getPlayerName(player) ) then 
        outputChatBox ( "Vehicle owner: Jumper_Mych", player ) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) 

Link to comment
what are you trying to do? i would recommend doing something like this:
vehicle = createVehicle ( 496, 2425, -55, 27, 0, 0, 0 ) 
setElementData(vehicle,"vehicle","car") 
setElementData(vehicle, "owner", "Jumper_Mych") 
  
function enterVehicle ( player, seat, jacked ) 
    if (getElementData(source, "vehicle" ) == "car") and ( not getElementData(source, "owner" ) == getPlayerName(player) ) then 
        outputChatBox ( "Vehicle owner: Jumper_Mych", player ) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) 

Weak code and doesn't work

Topic to scrap

But thanks you Solidsnake14 was first code work

Link to comment
vehicle = createVehicle ( 496, 2425, -55, 27, 0, 0, 0 ) 
setElementData(vehicle,"vehicle","car") 
setElementData(vehicle, "owner", "Jumper_Mych") 
  
function enterVehicle ( player, seat, jacked ) 
    if (getElementData(source, "vehicle" ) == "car") and ( getElementData(source, "owner" ) ~= getPlayerName(player) ) then 
        outputChatBox ( "Vehicle owner: Jumper_Mych", player ) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) 

you only had to remove "not" and change "==" to "~=" -_-

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