Jump to content

Flying Turismo


Akam

Recommended Posts

Posted

How to make a script, that just makes a tursimo to fly, not other cars, and make it so that only admins can enter the turismo.

thanks for your help :)

Posted
getVehicleType 
setWorldSpecialPropertyEnabled 

what should i do with that? can you give me a complete script?

Posted

You have to make a script with those functions, tho if you don't know how you might want to pay someone to script it for you.

Posted

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?

Posted

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 

Posted
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:

Posted

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?

Posted (edited)
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
Posted

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 
) 

Posted
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 ')'

Posted

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.

Posted
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

Posted
Why don't you finish it? for sure we aren't your slaves nor employeed by you, use this function.
setVehicleLocked 

lol but thanks :) for your help :)

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