Jump to content

Piorun

Members
  • Posts

    421
  • Joined

  • Last visited

Everything posted by Piorun

  1. Because i'm creating a control panel for every players, and i want to create simple menu i the top of the screen and i want just test this function
  2. Don't worry . My next problem. I create a function "zmienKolor" and it doesn't works function zmienKolor() guiLabelSetColor(v, 255, 0, 0) end after click of cors..
  3. Ok, but when i add this i didn't see my rectangle (this is my rest of function): function controlPanel() Button = {} Button[1] = guiCreateLabel(8,0,59,20,"Postacie",false) guiLabelSetHorizontalAlign(Button[1],"center",false) Button[2] = guiCreateLabel(77,0,59,20,"Przyjaciele",false) guiLabelSetHorizontalAlign(Button[2],"center",false) Button[3] = guiCreateLabel(146,0,59,20,"Statystyki",false) guiLabelSetHorizontalAlign(Button[3],"center",false) Button[4] = guiCreateLabel(215,0,40,20,"Opcje",false) guiLabelSetHorizontalAlign(Button[4],"center",false) Button[5] = guiCreateLabel(265,0,47,20,"Pomoc",false) guiLabelSetHorizontalAlign(Button[5],"center",false) for i,v in ipairs(Button) do addEventHandler( "onClientGUIClick", v[i], zmienKolor, false ) end -- Direct X Drawing addEventHandler("onClientRender",root, function() dxDrawRectangle(0.0,0.0,1024.0,20.0,tocolor(0,0,0,191),false) end ) end why?
  4. Hi. Firstly - my lua code: Button = {} Button[1] = guiCreateLabel(8,0,59,20,"Postacie",false) guiLabelSetHorizontalAlign(Button[1],"center",false) Button[2] = guiCreateLabel(77,0,59,20,"Przyjaciele",false) guiLabelSetHorizontalAlign(Button[2],"center",false) Button[3] = guiCreateLabel(146,0,59,20,"Statystyki",false) guiLabelSetHorizontalAlign(Button[3],"center",false) Button[4] = guiCreateLabel(215,0,40,20,"Opcje",false) guiLabelSetHorizontalAlign(Button[4],"center",false) Button[5] = guiCreateLabel(265,0,47,20,"Pomoc",false) guiLabelSetHorizontalAlign(Button[5],"center",false) addEventHandler( "onClientGUIClick", Button, zmienKolor, false ) Ok, i have this one. I want to add this Event for every "Button" element in this function. How?
  5. Holy motherf***er .. nice, it's working ... Thanks a lot.
  6. Hi guys. I've got code: addEventHandler("onClientResourceStart", getRootElement(), function() mainPlayer = getLocalPlayer() local data = getElementData(mainPlayer, "logged") if data==false then outputDebugString("Started") triggerServerEvent("onClientConnectToSerwer", getRootElement(), mainPlayer) end end) Why when i start my server and join into i see two times "Started"?? And why when i restart resource i see only once?
  7. W ogóle opóźnij tą czynność. Wsadź do funkcji z "onResourceStart" timer np. na 3 sekundy i dopiero wtedy utwórz oddzielną funkcję tworzącą peda.
  8. i found !!! not math.floor, but math.ceil. Thanks
  9. Ok nice, but now i don't see numbers after dot, but when player have for ex. 30% health script shows 29%, when 31%, then script shows 30% etc.
  10. Hi guys Today i've got problem with .. numbers . What i mean? - Picture: http://img845.imageshack.us/img845/4199/helt.jpg I create some simple script who shows local player curent his health value. Problem is when player have less than 100 of his health then he see a bad number. For ex. - player have 30% of health, but script shows 29.037..[...]%. I want to round off to the whole this value. Can I?
  11. Zdaje się, że temat dawno powinien być w koszu z powodu braku zainteresowania z czyjejkolwiek strony, oraz z braku obecności twórcy tematu (Last visited: Sun May 29, 2011 5:27 am - to jest też data założenia wątku).
  12. Hi guys. In samp scripters are using a playerid. It's a number of player. How to create function which i can set player this id??
  13. Piorun

    FPS

    Hi I have a question: How to get amount of FPS of local player?
  14. I'm talking about map file, not resource -.- .. In topic i wrote "...map called ex. 'hotel.map' ", and i think this should be an answer of your questions
  15. Hi again. I've got question: Which function i should use to load/unload map called ex. "hotel.map"? Ex. using a command called "/loadhotel" and "/unloadhotel".
  16. Yes, it is, but you added it without any event, and it works when i restart Resource (you added "addEventHandler" in coment, so i don't know what to do ) ... Thanks anyway everyone
  17. Yo, please close this topic, because i found solution of my problem - I added a timer with func getingPlayerBizPos into "onResourceStart" event .. and it's works ... Thanks for all .
  18. But in "onResourceStart" it doesn't works... so i can use only "onPlayerJoin" or "onPlayerLogin".
  19. @Solidsnake14 - when i'm using onPlayerJoin it's work but when i type in console "restart [res name]" then everything is turning off, and pff.. doesn't work. @Wojak - I will try your code .. but I have mixed feelings...
  20. Nothing is working cool. I check every code that you are post here, but still doesn't work. @UP my data's are good, i check it few days ago.
  21. Haha .. sh** - it's working .. thanks Citizen. @EDIT F*** - it doesn't work for a player who join into the server -.-. Only when player is on server and resource is restarting.
  22. Ok, so i changed my code to: CLIENT function exampleGetFunc( bizx, bizy, bizz, bizname ) addEventHandler("onClientRender", getRootElement(), function() local cx, cy, cz = getElementPosition( localPlayer ) local dist = getDistanceBetweenPoints3D( bizx, bizy, bizz, cx, cy, cz ) if dist <= 2 then outputChatBox(bizname) end end) end addEvent("playerPos", true) addEventHandler("playerPos", getRootElement(), exampleGetFunc) SERVER: function getingPlayerBizPos() 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"] bizid = data["id"] bizname = data["name"] triggerClientEvent("playerPos", getRootElement(), bizx, bizy, bizz, bizname) end mysql_free_result(result) end end addEventHandler("onResourceStart", getRootElement(), getingPlayerBizPos) and i still have the same errors, but when i change addEventHandler from "onResourceStart" to ex "onPlayerLogin" - it's working with no errors.
  23. I changed my code to: CLIENT function gettingPlayerPos (bizx, bizy, bizz) outputDebugString("Yo") -- for test local cx, cy, cz = getElementPosition( localPlayer ) if cx == bizx and cy == bizy and cz == bizz then outputChatBox("Witaj") end end addEvent("gettingPos", true) addEventHandler("gettingPos", getRootElement, gettingPlayerPos) SERVER 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"] bizid = data["id"] bizname = data["name"] triggerClientEvent("gettingPos", getRootElement(), bizx, bizy, bizz) end mysql_free_result(result) end end) because i found one bad thing with event "onResourceStart". Now works only serverside function (tested), clientside function still doesn't work, but now, when i'm typing "debugscript 3" in console i've got this errors:
×
×
  • Create New...