Jump to content

Piorun

Members
  • Posts

    421
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Piorun

  1. I've got this code : Server side : function gettingPlayerPos() addEventHandler("onResourceStart", getRootElement(), function () local result = mysql_query(handler, "SELECT * FROM tc_biznesy" ) if (result) then while true do local data = mysql_fetch_assoc(result) if (not data) then break end bizx = data["bizx"] bizy = data["bizy"] bizz = data["bizz"] triggerClientEvent("gettingPos", getRootElement(), bizx, bizy, bizz) end mysql_free_result(result) end end) end Client side: function gettingPlayerPos (bizx, bizy, bizz) addEventHandler("onClientRender", getRootElement(), function () local cx, cy, cz = getElementPosition( localPlayer ) if cx == bizx and cy == bizy and cz == bizz then outputChatBox("Witaj") end end) end addEvent("gettingPos", true) addEventHandler("gettingPos", getRootElement(), gettingPlayerPos) This code doesn't work. I want to do something like this: When player is on the bizx, bizy, bizz (data["bizx"], data["bizy"], data["bizz"]) position then server outputing into the client "Witaj" messege. Please, help
  2. He need instruction, i think.
  3. @Tony - your answer is not good, because it's good only for me, but how i say everyone everyday "write showChat in console, it will be cool" .. - no @Soildsnake14 - Thank you
  4. Hi everyone - i've got a problem with GUI Edit. When i'm writing something with for ex. key "t" output chat function is starting. When i'm writing someting with "a", "d" keys my ped is walking left and right. How to disable it??
  5. Piorun

    timer?

    So please - show us your code
  6. But meybe he want to disable chat option for every player, but show a masseges sending from the server only?? This is a problem -.-.
  7. first: not if guiGetVisible(ScreenLocked, true) but if guiGetVisible(ScreenLocked)==true And login in your server and write in console "debugscript 3" and show us your warnings please
  8. But .. hmm .. what is wrong ??
  9. Hmm .. i think you have too right
  10. Piorun

    mysql query

    I've got problem with this line: mysql_query(handler, "CREATE TABLE tc_example(id INT NOT NULL AUTO_INCREMENT)" ) What i'm doing wrong??? P.S. handler return true, but table is not creating... -.-
  11. I found a problem. I have too many times state=="up". I change once to state=="down" and it works
  12. I want to: 1. Create a Window with a Edit 2. After click on button called "Dalej" and after click on world create a pickup with the dxText Everything is working (with my code), but when i'm clicking on button pickup is creating too. This is my problem.
  13. Hi, i create some script: Client: function clickExample(button, state) if button == "left" and state == "up" then biznescreation = 1 guiSetVisible(GUIEditor_Window[1], false) GUIEditor_Window[2] = guiCreateWindow(312,284,400,200,"Tworzenie biznesu cz.1",false) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Edit[1] = guiCreateEdit(9,59,381,26,"",false,GUIEditor_Window[2]) GUIEditor_Label[4] = guiCreateLabel(14,37,133,18,"Nazwa",false,GUIEditor_Window[2]) guiLabelSetColor(GUIEditor_Label[4],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) GUIEditor_Button[1] = guiCreateButton(297,165,93,24,"Dalej",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[1],"default-bold-small") addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], secBiznes, false ) end end function secBiznes() biznesname = guiGetText(GUIEditor_Edit[1]) guiSetVisible(GUIEditor_Window[2], false) biznescreation = 2 end addEventHandler("onClientClick", getRootElement(), function (button, state, ax, ay, wx, wy, wz) if state=="up" and button=="left" and biznescreation==2 then triggerServerEvent("onPickupBiznesCreate",getLocalPlayer(), wx, wy, wz) biznescreation = 0 showCursor(false) end end) function endBiznesCreation() for i,v in pairs(getElementsByType("pickup")) do if getElementData(v,"text") then local px, py, pz = getElementPosition (getLocalPlayer()) local wx, wy, wz = getElementPosition(v) dist = getDistanceBetweenPoints3D ( px, py, pz, wx, wy, wz ) if dist < 20.0 then local x, y = getScreenFromWorldPosition ( wx, wy, wz+0.5 ) if x then dxDrawText(biznesname,x,y+2,x+2,y,tocolor(0,0,0),1,"default-bold","center","center") dxDrawText(biznesname,x,y,x,y,tocolor(49,140,231),1,"default-bold","center","center") end end end end end addEventHandler("onClientRender",getRootElement(),endBiznesCreation) Server function pickupBiznes(wx, wy, wz) pickup = createPickup(wx,wy,wz+1,3,1272,0) setElementData(pickup,"text",true) end addEvent("onPickupBiznesCreate", true) addEventHandler("onPickupBiznesCreate", getRootElement(), pickupBiznes) Everything is cool - when i'm clicking on image function works, and when i'm clicking on button ("Dalej"), then window are not visible and pickup is creating. I want to click on the button, and after that (and after disable window), and after click on the world create a pickup, not at once.
  14. Wow .. it wokrs .. thanks man
  15. Now i've got this code: addEventHandler("onClientClick", getRootElement(), function (button, state, ax, ay, wx, wy, wz) if state=="up" and button=="left"then triggerServerEvent("onPickupBiznesCreate",getLocalPlayer(), wx, wy, wz) wx = wx wy = wy wz = wz end end) function endBiznesCreation() --triggerEvent("onPickup3Dtext", getLocalPlayer(), wx, wy, wz) local px, py, pz = getElementPosition (getLocalPlayer()) dist = getDistanceBetweenPoints3D ( px, py, pz, wx, wy, wz ) if dist < 20.0 then local x, y = getScreenFromWorldPosition ( wx, wy, wz ) if x then dxDrawText("Biznes",x,y+2,x+2,y,tocolor(0,0,0),1,"default-bold","center","center") dxDrawText("Biznes",x,y,x,y,tocolor(49,140,231),1,"default-bold","center","center") end end end addEventHandler("onClientRender",getRootElement(),endBiznesCreation) dxText doesn't work still ... and - how to create a table with wx, wy, wz???
  16. Yup. Still function is creating a pickup, but without a dxText.
  17. I want to create a pickup (this is not a porblem, because it's working cool) with 3D text (and that's the problem), but i don't know how to move coords from one function to any other function. @up your code doesn't work.
  18. Ok works everything, but now i add new code, and .. it doesn't work: function biznesPickup(button, state, ax, ay, wx, wy, wz) if state=="up" and button=="left" then triggerServerEvent("onPickupBiznesCreate",getLocalPlayer(), wx, wy, wz) outputChatBox(wx.." "..wy.." "..wz) end end addEvent("onPickup3Dtext", true) addEventHandler("onPickup3Dtext", getRootElement(), biznesPickup) addEventHandler("onClientClick", getRootElement(), biznesPickup) function endBiznesCreation(wx, wy, wz) triggerEvent("onPickup3Dtext", getLocalPlayer(), wx, wy, wz) local px, py, pz = getElementPosition (getLocalPlayer()) dist = getDistanceBetweenPoints3D ( px, py, pz, wx, wy, wz ) if dist < 20.0 then local x, y = getScreenFromWorldPosition ( wx, wy, wz, true ) if x then dxDrawText("Biznes",x,y+2,x+2,y,tocolor(0,0,0),1,"default-bold","center","center") dxDrawText("Biznes",x,y,x,y,tocolor(49,140,231),1,"default-bold","center","center") end end end addEventHandler("onClientRender",getRootElement(),endBiznesCreation)
  19. I've got codes : Client-side addEventHandler("onClientClick", getRootElement(), function (button, state, ax, ay, wx, wy, wz) if state=="up" then triggerServerEvent("onPickupBiznesCreate",getLocalPlayer()) outputChatBox(wx.." "..wy.." "..wz) end end) Server-side function pickupBiznes() createPickup(wx,wy,wz,3,1273) end addEvent("onPickupBiznesCreate", true) addEventHandler("onPickupBiznesCreate", getRootElement(), pickupBiznes) Now i write what works: Works only getting a cursor world pos x,y,z and outputing it to Chat Box, but i want create a pickup too on server side with this coords. Please help.
×
×
  • Create New...