Jump to content

script error ;-;


Recommended Posts

Code on server.lua:

function passbase(thePlayer)

triggerClientEvent(thePlayer, "senhadabase", getRootElement())

end

-----------------------------------------------------------------------------------------------

local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 )

local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0)

local marker2 = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0)

function moveGate(psource)

local Deadusergroup = getAccountName(getPlayerAccount(psource))

if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Bope")) then

moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9)

setTimer(moveBack, 5000, 1)

else

passbase()

end

end

addEventHandler("onMarkerHit", marker, moveGate)

function moveBack()

moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265)

end

result error: Bad argument @ 'triggerClientEvent' [Expected string at argument 1, got nil]

Link to comment

on client.lua is set:

function Senhadoportaobope()

PassBope = guiCreateWindow(308, 52, 261, 94, "Senha da Bope", false)

guiWindowSetSizable(PassBope, false)

Senha = guiCreateEdit(52, 29, 160, 21, "", false, PassBope)

OKbtn = guiCreateButton(30, 63, 71, 21, "OK", false, PassBope)

guiSetProperty(OKbtn, "NormalTextColour", "FF17FF00")

cancelarbtn = guiCreateButton(161, 63, 71, 21, "Cancelar", false, PassBope)

guiSetProperty(cancelarbtn, "NormalTextColour", "FFFF0000")

showCursor(true)

addEventHandler("onClientGUIClick", OKbtn, testedesenha, false)

addEventHandler("onClientGUIClick", cancelarbtn, fecharsenha, false)

end

addEvent("senhadabase", true)

addEventHandler("senhadabase", getRootElement(), Senhadoportaobope)

I would advise if I put:

AddEventHandler ("onMarkerHit" marker, passbase)

it works, only that no longer exits the function that I want would be to open a GUI if not BOPE group

Link to comment

use this in server-side!..

local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 ) 
local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) 
local marker2 = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) 
  
function moveGate(psource) 
local Deadusergroup = getAccountName(getPlayerAccount(psource)) 
if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Bope")) then 
moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9) 
setTimer(moveBack, 5000, 1) 
else 
triggerClientEvent(psource, "senhadabase", psource) 
end 
end 
addEventHandler("onMarkerHit", marker, moveGate) 
function moveBack() 
moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265) 
end 
  

Link to comment

when entering the marker it says this in the console:

[29/06/2015 14:39:21] ERROR: Base / server.lua: 104: attempt to place concatenate 'Deadusergroup' (a boolean value)

[29/06/2015 14:39:23] ERROR: Base / server.lua: 108: attempt to place call 'pSource' (the value userdata)

Link to comment
when entering the marker it says this in the console:

[29/06/2015 14:39:21] ERROR: Base / server.lua: 104: attempt to place concatenate 'Deadusergroup' (a boolean value)

[29/06/2015 14:39:23] ERROR: Base / server.lua: 108: attempt to place call 'pSource' (the value userdata)

Is Bope added in acl-Group? If not you will get error.

Link to comment
this code I'm working on three days ... I am new to it even more scripts so it does not show the GUI

I replaced Bope with admin group.. and it works...

local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 ) 
local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) 
local marker2 = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) 
  
function moveGate(psource) 
local Deadusergroup = getAccountName(getPlayerAccount(psource)) 
if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Admin")) then 
moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9) 
setTimer(moveBack, 5000, 1) 
else 
triggerClientEvent(psource, "senhadabase", psource) 
end 
end 
addEventHandler("onMarkerHit", marker, moveGate) 
function moveBack() 
moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265) 
end 
  

So, the problem is either you didn't create group in acl for "Bope"

Link to comment

WARNING: BaseBope/menu.lua:118: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]

ERROR: BaseBope/menu.lua:119: attempt to concatenate local 'Deadusergroup' (a boolean value)

It is to pop up a GUI that prompts for the password to become member of the group Bope

Server.lua

function baseloged() 
    if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Bope" ) ) then 
        cancelEvent() 
    else 
        local accountName = getAccountName(getPlayerAccount(source)) 
        aclGroupAddObject (aclGetGroup("Bope"), "user."..accountName) 
    end 
end 
  
  
----------------------------------------------------------------------------------------------- 
  
local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 ) 
local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) 
  
function moveGate(psource) 
     local Deadusergroup = getAccountName(getPlayerAccount(psource)) 
     if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Bope")) then 
          moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9) 
     else 
          triggerClientEvent(psource, "senhadabase", psource()) 
     end 
end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
function moveBack(psource) 
    local Deadusergroup2 = getAccountName(getPlayerAccount(psource)) 
     if isObjectInACLGroup("user."..Deadusergroup2, aclGetGroup("Bope")) then 
        moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265) 
     end 
end 
  
addEventHandler("onMarkerLeave", marker, moveBack) 

Client.lua

function Senhadoportaobope() 
        PassBope = guiCreateWindow(308, 52, 261, 94, "Senha da Bope", false) 
        guiWindowSetSizable(PassBope, false) 
  
        Senha = guiCreateEdit(52, 29, 160, 21, "", false, PassBope) 
        OKbtn = guiCreateButton(30, 63, 71, 21, "OK", false, PassBope) 
        guiSetProperty(OKbtn, "NormalTextColour", "FF17FF00") 
        cancelarbtn = guiCreateButton(161, 63, 71, 21, "Cancelar", false, PassBope) 
        guiSetProperty(cancelarbtn, "NormalTextColour", "FFFF0000")     
        showCursor(true) 
        addEventHandler("onClientGUIClick", OKbtn, testedesenha, false) 
        addEventHandler("onClientGUIClick", cancelarbtn, fecharsenha, false) 
end 
addEvent("senhadabase", true) 
addEventHandler("senhadabase", getRootElement(), Senhadoportaobope) 
  
senhaofbasebope = "1234567" 
  
function testedesenha() 
    local pass = guiGetText(Senha) 
    if (pass == senhaofbasebope) then 
        triggerServerEvent ( "baseloged", getLocalPlayer() ) 
    end 
end 
  
function fecharsenha() 
    showCursor(false) 
    guiSetVisible (PassBope, not guiGetVisible ( PassBope ) ) 
end 

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