Jump to content

Gordon_G

Members
  • Posts

    282
  • Joined

  • Last visited

Everything posted by Gordon_G

  1. Hello ! So maybe you will think I'm stupide but I have a basic question ... I try to make something like this : server -> client -> server. Show that : -- first : Server function perceporte2(source) pos1,pos2,pos3 = getElementPosition(source) perceporteobject = createObject(3031,pos1,pos2,pos3) triggerClientEvent("perceporteson2",source, pos1,pos2,pos3) end addCommandHandler("perceporte2", perceporte2) -- second : Client addEvent("perceporteson2", true) function perceporteson2(a,b,c) local perceporteson = playSound3D("perce-porte.wav",a,b,c,true) setTimer( function(a) stopSound(perceporteson) triggerServerEvent("portelocked2",localPlayer) end, 1000,1,perceporteson) end addEventHandler("perceporteson2", getRootElement(),perceporteson2) -- third : Server function portelocked2() destroyElement(perceporteobject) end addEventHandler("portelocked2", getRootElement(), portelocked2) It's not exactly what I want to make but it's the idea so, don't say me : "Just make the commandHandler in client script." Ok, the script work but ... When there is two players ... So someone could explain me ? Please
  2. That's work ! And, I learnt to script myself so I don't now everything yet. I am scripting a gamemode and, you helped me a lot triggerClientEvent("achatarmesgui", source) addEventHandler("achatarmesgui", getLocalPlayer(),achatarmes)
  3. Thanks a lot ! I'll immediatly try that
  4. Ok, so ... I will try to explain everything correctly. I try to make a GUI visible by a server script and ... For some reason does that I don't know for the moment everyone see this GUI ... But I just wanna that the source of the server side can see the GUI. You understand ? --Server function seegui(source) triggerClientEvent("achatarmesgui",root, source) end addCommandHandler("seegui", seegui) --Client prixarmes = { neufmm = {1500,22}, tecneuf = {4000,30}, deagle = {3000,24}, ak = {7000,32}, shotgun = {5500,25}, } local screenW, screenH = guiGetScreenSize() achatarmess = guiCreateWindow((screenW - 608) / 2, (screenH - 347) / 2, 608, 347, "Achat armes", false) guiWindowSetSizable(achatarmess, false) guiSetVisible ( achatarmess, false ) eaglei = guiCreateStaticImage(10, 171, 95, 95, "deserteagle.png", false, achatarmess) neufi = guiCreateStaticImage(10, 48, 95, 95, "9mm.png", false, achatarmess) teci = guiCreateStaticImage(142, 52, 95, 95, "tec9.png", false, achatarmess) shotguni = guiCreateStaticImage(261, 52, 95, 95, "shotgun.png", false, achatarmess) aki = guiCreateStaticImage(405, 56, 95, 95, "ak47.png", false, achatarmess) achatarmeslabel1 = guiCreateLabel(20, 143, 75, 17, prixarmes.neufmm[1], false, achatarmess) achatarmeslabel2 = guiCreateLabel(152, 143, 75, 17, prixarmes.tecneuf[1], false, achatarmess) achatarmeslabel3 = guiCreateLabel(20, 276, 75, 17, prixarmes.deagle[1], false, achatarmess) achatarmeslabel4 = guiCreateLabel(271, 143, 75, 17, prixarmes.shotgun[1], false, achatarmess) achatarmeslabel5 = guiCreateLabel(419, 143, 75, 17, prixarmes.ak[1], false, achatarmess) buttonclose = guiCreateButton(569, 23, 29, 25, "X", false, achatarmess) addEvent("achatarmesgui", true) function achatarmes() guiSetVisible(achatarmess, true) showCursor(true,true) end addEventHandler("achatarmesgui", root,achatarmes) So ... Could someone explain me ? Please
×
×
  • Create New...