It is spawn gui!
Client.lua
----------------------------This side doesn't need to change,you can change Server side.This one only for trigger to the server ---------------------
GUIEditor = {
gridlist = {},
window = {},
button = {}
}
function SetMenuVisibleTrue ()
--===Core===--
GUIEditor.window[3] = guiCreateWindow(485, 268, 352, 361, "Spawn Menu", false)
guiWindowSetSizable(GUIEditor.window[3], false)
GUIEditor.button[4] = guiCreateButton(75, 35, 188, 69, "Army", false, GUIEditor.window[3])
GUIEditor.button[5] = guiCreateButton(74, 158, 189, 68, "Civilian", false, GUIEditor.window[3])
GUIEditor.button[6] = guiCreateButton(75, 273, 188, 66, "Gangs", false, GUIEditor.window[3])
showCursor ( true )
addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.button[6] then
outputChatBox ("This feature in the Development.Try it later")
end
if source == GUIEditor.button[4] then
if GUIEditor.window[4] then
destroyElement ( GUIEditor.window[4] )
end
GUIEditor.window[4] = guiCreateWindow(868, 268, 174, 363, "Army Spawn", false)
guiWindowSetSizable(GUIEditor.window[4], false)
GUIEditor.gridlist[2] = guiCreateGridList(9, 21, 155, 113, false, GUIEditor.window[4])
guiGridListAddColumn(GUIEditor.gridlist[2], "Spawnpoints", 0.9)
for i = 1, 2 do
guiGridListAddRow(GUIEditor.gridlist[2])
end
guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Zone 69", false, false)
guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Zone 51", false, false)
addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.gridlist[2] then
name = guiGridListGetItemText ( GUIEditor.gridlist[2], guiGridListGetSelectedItem (GUIEditor.gridlist[2]), 1 )
if name == "Zone 69" then
triggerServerEvent ("ArmyZone69",localPlayer)
destroyElement(GUIEditor.gridlist[2])
destroyElement(GUIEditor.window[4])
destroyElement(GUIEditor.window[3])
showCursor ( false )
end
if name == "Zone 51" then
triggerServerEvent ("ArmyZone51",localPlayer)
destroyElement(GUIEditor.gridlist[2])
destroyElement(GUIEditor.window[4])
destroyElement(GUIEditor.window[3])
showCursor ( false )
end
end
end)
end
if source == GUIEditor.button[5] then
if GUIEditor.window[1] then
destroyElement ( GUIEditor.window[1] )
end
GUIEditor.window[1] = guiCreateWindow(226, 277, 224, 363, "Civilian", false)
guiWindowSetSizable(GUIEditor.window[1], false)
GUIEditor.gridlist[1] = guiCreateGridList(9, 22, 205, 118, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "Spawnpoints", 0.9)
for i = 1, 5 do
guiGridListAddRow(GUIEditor.gridlist[1])
end
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "[LS]Grove Street", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "[LS]Port", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "[LS]Center", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "[LV]Bus Station", false, false)
addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.gridlist[1] then
nameCivillian = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 1 )
if nameCivillian == "[LS]Grove Street" then
destroyElement(GUIEditor.window[1])
destroyElement(GUIEditor.gridlist[1])
triggerServerEvent ("GroveStreet",localPlayer)
destroyElement(GUIEditor.window[3])
showCursor ( false )
elseif nameCivillian == "[LS]Port" then
destroyElement(GUIEditor.window[1])
destroyElement(GUIEditor.gridlist[1])
triggerServerEvent ("LSPORT",localPlayer)
destroyElement(GUIEditor.window[3])
showCursor ( false )
elseif nameCivillian == "[LS]Center" then
destroyElement(GUIEditor.window[1])
triggerServerEvent ("LVCENTER",localPlayer)
destroyElement(GUIEditor.window[3])
showCursor ( false )
elseif nameCivillian == "[LV]Bus Station" then
destroyElement(GUIEditor.window[1])
destroyElement(GUIEditor.gridlist[1])
triggerServerEvent ("LSBUSSTATION",localPlayer)
destroyElement(GUIEditor.window[3])
showCursor ( false )
end
end
end)
end
end)
end
addEvent ("visiblemenu",true)
addEventHandler ("visiblemenu",getRootElement(),SetMenuVisibleTrue)
addEventHandler ("onClientPlayerWasted",getLocalPlayer(),SetMenuVisibleTrue)
server.lua
---------------------------Settings:-----------------------------------
--==[Army - {LV\SF}]==--
--==Zone 51==--
Zone51X,Zone51Y,Zone51Z = 214.29565, 1856.56372, 13.09107
SPMENUtriggerZone51_Weapon = 31
SPMENUtriggerZone51_Weapon_ammo = 100
SPMENUtriggerZone51_Skin = 287
--==Zone 69==--
Zone69X,Zone69Y,Zone69Z = -1347.93640, 495.12314, 18.23438
SPMENU_triggerZone69_Weapon = 29
SPMENU_triggerZone69_Weapon_ammo = 100
SPMENU_triggerZone69_Skin = 287
--==[CIVILIAN - {LS}]==--
--==Grove Street==--
LS_groveX,groveY,groveZ = 2473.25806, -1686.48108, 13.50781
SPMENU_triggerCIVILIAN_SkinGrove = math.random ( 15,150 )
--==[LS]Port==--
LS_portX,portY,portZ = 2443.36768, -2458.22974, 13.62500
SPMENU_triggerCIVILIAN_SkinPort = math.random ( 10,150 )
--==[LS]CENTER==--
LS_centerX,centerY,centerZ = 1311.64001, 2085.39111, 10.82031
SPMENU_triggerCIVILIAN_SkinCenter = math.random ( 10,150 )
--==[LS]Bus Station==--
LS_busstationX,busstationportY,busstationportZ = 1789.77136, -1936.38538, 13.54688
SPMENU_triggerCIVILIAN_SkinBusStation = math.random ( 10,150 )
----------------------CORE------------------------------
function SpawnPlayerAsZone51 ()
outputChatBox ("You spawned as Army Team: 'Zone 51'!",source,math.random(1,255),math.random(1,255),math.random(1,255))
spawnPlayer ( source , Zone51X,Zone51Y,Zone51Z )
giveWeapon ( source , SPMENUtriggerZone51_Weapon ,SPMENUtriggerZone51_Weapon_ammo )
setPedSkin ( source ,SPMENUtriggerZone51_Skin )
end
addEvent ("ArmyZone51",true)
addEventHandler ("ArmyZone51",getRootElement(),SpawnPlayerAsZone51)
function SpawnPlayerAsZone69 ()
outputChatBox ("You spawned as Army Team: 'Zone 69'!",source,math.random(1,255),math.random(1,255),math.random(1,255))
spawnPlayer ( source ,Zone69X,Zone69Y,Zone69Z )
giveWeapon ( source ,SPMENU_triggerZone69_Weapon , SPMENU_triggerZone69_Weapon_ammo )
setPedSkin ( source ,SPMENU_triggerZone69_Skin )
end
addEvent ("ArmyZone69",true)
addEventHandler ("ArmyZone69",getRootElement(),SpawnPlayerAsZone69)
function SpawnPlayerAsCIVILIANGROVE ()
outputChatBox ("You spawned as Civilian!Position: ---> Grove Street <---",source,math.random(1,255),math.random(1,255),math.random(1,255))
spawnPlayer ( source ,LS_groveX,groveY,groveZ )
setPedSkin ( source ,SPMENU_triggerCIVILIAN_SkinGrove )
end
addEvent ("GroveStreet",true)
addEventHandler ("GroveStreet",getRootElement(),SpawnPlayerAsCIVILIANGROVE)
function SpawnPlayerAsCIVILIANPORT ()
outputChatBox ("You spawned as Civilian!Position: ---> Port <--- ",source,math.random(1,255),math.random(1,255),math.random(1,255))
spawnPlayer ( source , LS_portX,portY,portZ )
setPedSkin ( source , SPMENU_triggerCIVILIAN_SkinPort)
end
addEvent ("LSPORT",true)
addEventHandler ("LSPORT",getRootElement(),SpawnPlayerAsCIVILIANPORT)
function SpawnPlayerAsCivilianCenter ()
outputChatBox ("You spawned as Civilian!Position: ---> CENTER <--- ",source,math.random(1,255),math.random(1,255),math.random(1,255))
spawnPlayer ( source ,LS_centerX,centerY,centerZ)
setPedSkin ( source , SPMENU_triggerCIVILIAN_SkinCenter)
end
addEvent ("LVCENTER",true)
addEventHandler ("LVCENTER",getRootElement(),SpawnPlayerAsCivilianCenter)
function SpawnPlayerAsCIVILIANBUSSTATION ()
outputChatBox ("You spawned as Civilian!Position: ---> Bus Station <--- ",source,math.random(1,255),math.random(1,255),math.random(1,255))
spawnPlayer ( source ,LS_busstationX,busstationportY,busstationportZ )
setPedSkin ( source , SPMENU_triggerCIVILIAN_SkinBusStation)
end
addEvent ("LSBUSSTATION",true)
addEventHandler ("LSBUSSTATION",getRootElement(),SpawnPlayerAsCIVILIANBUSSTATION)
--------------------------Don't change it,or system will be not work!---------------------------------------
---==[[[]]]]==---
function StartAllProccessWindow ()
triggerClientEvent (source,"visiblemenu",getRootElement())
end
addEventHandler ("onPlayerJoin",getRootElement(),StartAllProccessWindow)
----=[[[]]]=----