Jump to content

Gate Did'nt working


Perfect

Recommended Posts

Posted

Hi All, I make this gate but its not working.

mgate1 = createObject ( 989, 864.5, -3973, 2.2999999523163, 0, 0, 267.99499511719 ) 
  
function opengate(thePlayer) 
local id = getElementModel (thePlayer) 
          moveObject ( mgate1, 1000, 859.79998779297, -3972.6000976563, 2.0999999046326 ) 
end 
addCommandHandler("mopen", opengate) 
  
function closegate(theplayer) 
local id = getElementModel (thePlayer) 
           moveObject ( mgate1, 1000, 864.5, -3973, 2.2999999523163 ) 
end 
addCommandHandler("mclose", closegate) 
  

Meta

    "Perfect" name="gates" version="1.2.0" type="script"/> 
    

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
  
mgate1 = createObject ( 989, 864.5, -3973, 2.2999999523163, 0, 0, 267.99499511719 ) 
  
function opengate(thePlayer) 
local id = getElementModel (thePlayer) 
          moveObject ( mgate1, 1000, 859.79998779297, -3972.6000976563, 2.0999999046326 ) 
end 
addCommandHandler("mopen", opengate) 
  
function closegate(thePlayer) -- thePlayer not theplayer 
local id = getElementModel (thePlayer) 
           moveObject ( mgate1, 1000, 864.5, -3973, 2.2999999523163 ) 
end 
addCommandHandler("mclose", closegate) 
  
  

Script should work and had no problem unless that it couldnt gain the element model in the last function because you used theplayer in function and thePlayer in model.

Posted

lol, only :P. ok can you tell me how to do this for admins only ?

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Guest Guest4401
Posted

isObjectInACLGroup

E.g:

if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup"Admin") then 

Posted
lol, only :P. ok can you tell me how to do this for admins only ?
local accName = getAccountName(getPlayerAccount(source)) 
if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then 
 -- your code 

F4MZM4.gif

Posted

Oh wait, that still not working, there is no gate and i put that server side or client side ?

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

ok, ok and why that still not working ?

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

Debug

WARNING: Script 'gates/gates.lua' is not encoded in UTF-8. Loading as ANSI...

WARNING: Loading script failed: gates\gates.lua:1: unexpected symbol near '('

Fullcode

gates.lua

mgate1 = createObject ( 989, 864.5, -3973, 2.2999999523163, 0, 0, 267.99499511719 ) 
  
function opengate(thePlayer) 
local id = getElementModel (thePlayer) 
          moveObject ( mgate1, 1000, 859.79998779297, -3972.6000976563, 2.0999999046326 ) 
end 
addCommandHandler("mopen", opengate) 
  
function closegate(thePlayer) 
local id = getElementModel (thePlayer) 
           moveObject ( mgate1, 1000, 864.5, -3973, 2.2999999523163 ) 
end 
addCommandHandler("mclose", closegate) 
  

meta.xml

    "Sterick" name="gates" version="1.2.0" type="script"/> 
    

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
nothing wrong with it, and those errors are false.

Use /restart gates

i try many times but still not working :(

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

Your problem not in the code

the problem from the encoded

change it to UTF-8

and it will work just fine.

CiTLh.png
Posted
Your problem not in the code

the problem from the encoded

change it to UTF-8

and it will work just fine.

What is uncoded ?

and how to change it to UTF-8 ?

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
Your problem not in the code

the problem from the encoded

change it to UTF-8

and it will work just fine.

What is uncoded ?

and how to change it to UTF-8 ?

with Notepad: File > Save As > Encoding: UTF-8 > Save

done.

CiTLh.png
Posted

Thank You So Much!!! :D

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

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