Jump to content

Question


xeon17

Recommended Posts

I'm wanna make a gate who open when player get in contact with the Gate, and close when player is away from Gate.

this is my frist time , so i ask is this code correct ?

local gate = createObject(id, x, y, z, rx, ry, rz) 
local marker = createMarker(x, y, z, "cylinder", 2, 0, 200, 255) 
function openGate (hitPlayer, matchingDimension) 
moveObject(gate, x, y, z)  
end 
addEventHandler("onClientMarkerHit", marker, openGate) 
      
function closeGate(leavingPlayer, matchingDimension) 
moveObject(gate, x, y, z)  
end 
addEventHandler("onClientMarkerLeave", marker, closeGate) 
  

Link to comment

Ahh Sorry , there was writed an author i copyed only the script.

local gate = createObject(id, x, y, z, rx, ry, rz) 
local marker = createMarker(x, y, z, "cylinder", 2, 0, 200, 255) 
function openGate (hitPlayer, matchingDimension) 
moveObject(gate, x, y, z)  
end 
addEventHandler("onClientMarkerHit", marker, openGate) 
      
function closeGate(leavingPlayer, matchingDimension) 
moveObject(gate, x, y, z)  
end 
addEventHandler("onClientMarkerLeave", marker, closeGate) 
            

Now i get this bugs , wtf :?

[2014-01-25 12:47:50] Resource 'Gate' changed, reloading and starting 
[2014-01-25 12:47:50] Starting Gate 
[2014-01-25 12:47:50] WARNING: Gate\Garagem.lua:1: Bad argument @ 'createObject' [Expected number at argument 1, got nil] 
[2014-01-25 12:47:50] WARNING: Gate\Garagem.lua:2: Bad argument @ 'createMarker' 
[2014-01-25 12:47:50] WARNING: Gate\Garagem.lua:6: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] 
[2014-01-25 12:47:50] WARNING: Gate\Garagem.lua:11: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] 
[2014-01-25 12:47:50] Gate restarted successfully 

Link to comment

I know calm , i not started working yet :D i thank later :)

i got a problem with my other script what i crated before 2 minutes , when player join server if he have team it should give him outchatbox '-' but nothing happen

function Check ( player ) 
local playerTeam = getPlayerTeam ( player )           
if ( playerTeam ) then 
outputChatBox ( "#F4A460[GANG]#F08080 Bem vido a gang " .. getTeamFromName ( PlayerTeam ).." ! ", player, 255, 255, 255, true )        
end 
end 
addEventHandler ( "onPlayerLogin", root, Check ) 

i Tryed OnPlayerLogin too , idk what wrong , help TAPL :(

Link to comment
function Check ( source ) 
local playerTeam = getPlayerTeam ( source )           
if ( playerTeam ) then 
outputChatBox ( "#F4A460[GANG]#F08080 Bem vido a gang " .. getTeamName ( "PlayerTeam" ).." ! ", source, 255, 255, 255, true )       
end 
end 
addEventHandler ( "onPlayerLogin", root, Check ) 

no work :(

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