Jump to content

Flying Turismo


Akam

Recommended Posts

i really dont know how to script i dont know how to link server functions and client functions together and even if i learn i just can't do it cuz i am a noob but please can someone just make one?

Link to comment

i really dont know how to script i dont know how to link server functions and client functions together and even if i learn i just can't do it cuz i am a noob but please can someone just make one?

triggerClientEvent 
--or 
triggerServerEvent 

Link to comment
function FLY () 
local car = getVehicleName() 
      if ( car == Turismo ) then 
setWorldSpecialPropertyEnabled ( "aircars", true ) 
      end 
end 
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), FLY ) 

Now it is your turn :wink:

Link to comment
Why createVehicle? I think he wants it for Freeroam or something like that, so I guess he already has vehicles in map.

And if is in the map vehicle called Turismo, it will be flying.

Or not?

Right, but in this function getVehicleName you most write the vehicle in the first argument

Ex:

local vehicle = createVehicle(...) 
  
function FLY () 
local car = getVehicleName(vehicle) 
    if car == "Turismo" then 
       setWorldSpecialPropertyEnabled ( "aircars", true ) 
    else 
       outputChatBox("* Your vehicle isn't Turismo", localPlayer) 
    end 
end 
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), FLY ) 

Or if no't specific

Ex:

local vehicle = getElementType("vehicle") 
  
function FLY () 
local car = getVehicleName(vehicle) 
    if car == "Turismo" then 
       setWorldSpecialPropertyEnabled ( "aircars", true ) 
    else 
       outputChatBox("* Your vehicle isn't Turismo", source) 
    end 
end 
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), FLY ) 

Edited by Guest
Link to comment

Guys, you failed.

c.lua

addEvent("onEnter", true) 
addEventHandler("onEnter", root, 
function() 
setWorldSpecialPropertyEnabled("aircars", true) 
end 
) 
addEventHandler ("onClientVehicleExit", localPlayer, 
function(thePlayer, seat) 
        if thePlayer == getLocalPlayer() then 
setWorldSpecialPropertyEnabled ("aircars",false) 
end 
end 
) 
  

s.lua

addEventHandler("onVehicleEnter", root, 
function(thePlayer, seat, jacked) 
 local accName = getAccountName(getPlayerAccount(thePlayer)) 
if isObjectInACLGroup("user."..accName, aclGetGroup "Admin")) and (getElementModel(source) == 451) then 
triggerClientEvent(thePlayer, "onEnter", thePlayer) 
end 
end 
) 

Link to comment
Guys, you failed.

c.lua

addEvent("onEnter", true) 
addEventHandler("onEnter", root, 
function() 
setWorldSpecialPropertyEnabled("aircars", true) 
end 
) 
addEventHandler ("onClientVehicleExit", localPlayer, 
function(thePlayer, seat) 
        if thePlayer == getLocalPlayer() then 
setWorldSpecialPropertyEnabled ("aircars",false) 
end 
end 
) 
  

s.lua

addEventHandler("onVehicleEnter", root, 
function(thePlayer, seat, jacked) 
 local accName = getAccountName(getPlayerAccount(thePlayer)) 
if isObjectInACLGroup("user."..accName, aclGetGroup "Admin")) and (getElementModel(source) == 451) then 
triggerClientEvent(thePlayer, "onEnter", thePlayer) 
end 
end 
) 

error: Server.lua:4: 'then' expected near ')'

Link to comment

c.lua

addEvent("onEnter", true) 
addEventHandler("onEnter", root, 
function() 
setWorldSpecialPropertyEnabled("aircars", true) 
end 
) 
addEventHandler ("onClientVehicleExit", localPlayer, 
function(thePlayer, seat) 
        if thePlayer == getLocalPlayer() then 
setWorldSpecialPropertyEnabled ("aircars",false) 
end 
end 
) 

s.lua

addEventHandler("onVehicleEnter", root, 
function(thePlayer, seat, jacked) 
local accName = getAccountName(getPlayerAccount(thePlayer)) 
if isObjectInACLGroup("user."..accName, aclGetGroup "Admin") and (getElementModel(source) == 451) then 
triggerClientEvent(thePlayer, "onEnter", thePlayer) 
end 
end 
) 

And please next time, if you get such errors just fix it by yourself.

Link to comment
c.lua
addEvent("onEnter", true) 
addEventHandler("onEnter", root, 
function() 
setWorldSpecialPropertyEnabled("aircars", true) 
end 
) 
addEventHandler ("onClientVehicleExit", localPlayer, 
function(thePlayer, seat) 
        if thePlayer == getLocalPlayer() then 
setWorldSpecialPropertyEnabled ("aircars",false) 
end 
end 
) 

s.lua

addEventHandler("onVehicleEnter", root, 
function(thePlayer, seat, jacked) 
local accName = getAccountName(getPlayerAccount(thePlayer)) 
if isObjectInACLGroup("user."..accName, aclGetGroup "Admin") and (getElementModel(source) == 451) then 
triggerClientEvent(thePlayer, "onEnter", thePlayer) 
end 
end 
) 

And please next time, if you get such errors just fix it by yourself.

nice

but even when i am not an admin i can drive the car i want to let admin drive and i want non admins to sit in the seats

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