Jump to content

Problem - Spawning System


GerardWay

Recommended Posts

Posted

Hey, could anyone help with this? The GUI Shows, but the cursor does not. And when I click one of the buttons, nothing happens and in /debugscript 3 it says that it isnt added Serverside, yet it clearly is. Any help please?

Client.lua

GUIEditor = { 
     
button = {}, 
     
window = {} 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, 
     
function() 
         
GUIEditor.window[1] = guiCreateWindow(0, -4, 1366, 768, "", false) 
         
guiWindowSetSizable(GUIEditor.window[1], false) 
         
guiSetAlpha(GUIEditor.window[1], 1.00) 
  
         
Military = guiCreateButton(47, 130, 1278, 201, "Military", false, GUIEditor.window[1]) 
         
guiSetFont(Military, "sa-gothic") 
         
guiSetProperty(Military, "NormalTextColour", "FF3BFF00") 
         
Resistance = guiCreateButton(47, 472, 1278, 201, "Resistance", false, GUIEditor.window[1]) 
         
guiSetFont(Resistance, "sa-gothic") 
         
guiSetProperty(Resistance, "NormalTextColour", "FFFF0000")     
     
GUIEditor.label[1] = guiCreateLabel(133, 370, 1298, 68, "The Backup Server - Spawning System", false, GUIEditor.window[1])          
guiSetFont(GUIEditor.label[1], "sa-gothic")   
showCursor (true) 
end 
  
) 
  
showCursor (false) 
  
addEventHandler("onClientGUIClick", root, 
function() 
if source == Military then 
triggerServerEvent("Military", localPlayer) 
  
elseif source == Resistance then 
triggerServerEvent ("Military", localPlayer) 
destroyElement(GUIEditor_window[1]) 
showCursor (false) 
end 
end 
) 
  
addEvent("setSpawnVisible",true) 
addEventHandler("setSpawnVisible",root, 
function () 
guiSetVisible( GUIEditor_window[1], true ) 
setTimer( function () showCursor( true ) end, 1000,1) 
end 
) 

Server.lua

addEvent( "Military", true) 
addEventHandler( "Military", root, 
function()  
team1 = createTeam ("Military Forces", 0, 255, 0)                      
setPlayerTeam (source, team1) 
     
spawnPlayer (source, 207.90919, 1865.12842, 13.14063, 287, 0, 0) 
  
setElementModel (source, 287) 
fadeCamera (source, true) 
setCameraTarget (source, source) 
  
giveWeapon (source, 28, 2000) 
  
giveWeapon (source, 23, 2000) 
end 
) 
  
addEvent( "Resistance", true) 
addEventHandler( "Resistance", root, 
function()          
team2 = createTeam ("Resistance", 255, 0, 0)              
setPlayerTeam (source, team2) 
     
spawnPlayer (source, 1090.90808, 2115.29443, 15.35040, 7, 0, 0) 
  
setElementModel (source, 7) 
fadeCamera (source, true) 
setCameraTarget (source, source) 
  
giveWeapon (source, 28, 2000) 
  
giveWeapon (source, 23, 2000) 
end 
) 
  
addEventHandler ( "onPlayerLogin", root, 
addEventHandler ("onPlayerWasted", root, 
    function ( ) 
        triggerClientEvent ( source, "setSpawnVisible", source, true ) 
    end 
) 
  

Any help is appreciated as always, Thank You!

560x95_FFFFFF_FF9900_000000_000000.png
Posted

You are showing the cursor, then hidding it after.

Also, did you add the server side to the meta.xml and set it as a server side script?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

The meta.xml is correct, maybe the server side script has a script error, check the debugscript.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Yes, but do you get any errors coming from the server side script? use "/debugscript 3".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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