Jump to content

Warzone


S3Nn4oXx

Recommended Posts

You want to create a colShap with cmd at your position or what?

"Hello guys,

There is three Editboxes Y: X: Z: so how i make it when i fill the boxes so it creates a warzone"

Click on the function there's an example read it and try to make it ,if you failed post the code

"attempt to call global 'guiGetScreenSize' (a nil value)"

Line:

  
local screenW, screenH = guiGetScreenSize() 
  

Server.lua

  
  
GUIEditor = { 
    button = {}, 
    window = {}, 
    edit = {}, 
    label = {} 
} 
  
    function gui( ) 
        local screenW, screenH = guiGetScreenSize() 
        window = guiCreateWindow((screenW - 282) / 2, (screenH - 92) / 2, 282, 92, "WarZone Control ", false) 
        guiWindowSetSizable(window, false) 
  
        create = guiCreateButton(114, 64, 54, 18, "Create", false, window) 
        guiSetProperty(create, "NormalTextColour", "FFAAAAAA") 
        yt = guiCreateLabel(10, 36, 44, 25, "Y:", false, window) 
        boxe = guiCreateEdit(33, 33, 57, 21, "", false, window) 
        xt = guiCreateLabel(100, 36, 21, 18, "X:", false, window) 
        boxe1 = guiCreateEdit(121, 33, 57, 21, "", false, window) 
        zt = guiCreateLabel(188, 36, 21, 18, "Z:", false, window) 
        boxe2 = guiCreateEdit(209, 33, 57, 21, "", false, window)     
        addEventHandler ( "onClientGUIClick", create, setZone, false ) 
    end 
addCommandHandler( "warzone", gui ) 
  
  
function setZone ( playerSource, fX, fY ) 
    if ( fY and fX ) then  
        local tempCol = createColRectangle ( fX, fY, 10.0, 10.0 )  
        if ( tempCol == false ) then 
        else 
            if ( theZone ~= false ) then  
                destroyElement ( theZone )  
            end 
            theZone = tempCol  
        end 
    end 
end  
  

and GUI I can make it only in Client side, how do i make it in server side?

Link to comment
Put client and server side functions on its own side. Use trigger to make client - server side communication.
triggerServerEvent 
  
triggerClientEvent 

It's my first time that I'm using it '-'

server.lua:

  
function awe ( playerSource, fX, fY ) 
    if ( fY and fX ) then  
        local tempCol = createColRectangle ( fX, fY, 10.0, 10.0 )  
        if ( tempCol == false ) then 
        else 
            if ( theZone ~= false ) then  
                destroyElement ( theZone )  
            end 
            theZone = tempCol  
        end 
    end 
end  
addEvent( "zone", true ) 
addEventHandler( "zone", resourceRoot, awe ) 
  

client.lua:

  
  
GUIEditor = { 
    button = {}, 
    window = {}, 
    edit = {}, 
    label = {} 
} 
  
    function gui( ) 
        local screenW, screenH = guiGetScreenSize() 
        window = guiCreateWindow((screenW - 282) / 2, (screenH - 92) / 2, 282, 92, "WarZone Control ", false) 
        guiWindowSetSizable(window, false) 
  
        create = guiCreateButton(114, 64, 54, 18, "Create", false, window) 
        guiSetProperty(create, "NormalTextColour", "FFAAAAAA") 
        yt = guiCreateLabel(10, 36, 44, 25, "Y:", false, window) 
        boxe = guiCreateEdit(33, 33, 57, 21, "", false, window) 
        xt = guiCreateLabel(100, 36, 21, 18, "X:", false, window) 
        boxe1 = guiCreateEdit(121, 33, 57, 21, "", false, window) 
        zt = guiCreateLabel(188, 36, 21, 18, "Z:", false, window) 
        boxe2 = guiCreateEdit(209, 33, 57, 21, "", false, window)     
        addEventHandler ( "onClientGUIClick", create, setZone, false ) 
    end 
addCommandHandler( "warzone", gui ) 
  
function setZone( ) 
 triggerServerEvent ( "zone", resourceRoot ) 
end  
  

How can i make it in client.lua ?

  
local screenW, screenH = guiGetScreenSize() 
  

ERROR

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