Jump to content

Drakath

Members
  • Posts

    768
  • Joined

  • Last visited

Everything posted by Drakath

  1. Drakath

    XML

    Well it only returns the first line. While for the Vector's code, I tried this: local xmlFile = xmlLoadFile("blocks.xml") local children = xmlNodeGetChildren(xmlFile) outputChatBox(playername) for _, child in ipairs(children) do outputChatBox(xmlNodeGetValue(child)) if (xmlNodeGetValue(child) == playername) then xmlDestroyNode(child) outputChatBox("deleted") playername outputted correctly but xmlNodeGetValue(child) outputted nil. Why?
  2. Drakath

    XML

    That requires to define index.
  3. Drakath

    XML

    Is it possible to xmlDestroyNode if I know the tagName and its value but no index?
  4. Drakath

    Grid lists

    Lol, I had no idea it could be something in GUI. Thanks.
  5. Drakath

    Grid lists

    I have a strange problem with grid lists. Here is the code: window = guiCreateWindow(0.8,0.30,0.20,0.40,"xD",true) animsTP = guiCreateTabPanel(0.11, 0.19, 0.79, 0.66, true, window) FanimsTab = guiCreateTab("ok", animsTP) stfu = guiCreateTab("blablabla", animsTP) FanimsGL = guiCreateGridList(0.01, 0.00, 0.99, 0.84, true, FanimsTab) guiGridListAddColumn(FanimsGL, "", 0.85) guiGridListSetSelectionMode(FanimsGL, 0) function whatever() local xmlFile = xmlLoadFile("test.xml") if xmlFile then if guiGridListClear(FanimsGL) then for key, node in pairs(xmlNodeGetChildren(xmlFile)) do local block = xmlNodeGetAttribute(node, "block") local anim = xmlNodeGetAttribute(node, "animation") local row = guiGridListAddRow(FanimsGL) guiGridListSetItemText(FanimsGL, row, 1, tostring(block), false, false) guiGridListSetItemData(FanimsGL, row, 1, tostring(key)) guiGridListSetItemText(FanimsGL, row, 2, tostring(anim), false, false) guiGridListSetItemData(FanimsGL, row, 2, tostring(anim)) local anim1 = guiGridListGetItemData(FanimsGL, guiGridListGetSelectedItem(FanimsGL), 2) local anim2 = guiGridListGetItemText(FanimsGL, guiGridListGetSelectedItem(FanimsGL), 2) local block1 = guiGridListGetItemText(FanimsGL, guiGridListGetSelectedItem(FanimsGL), 1) outputChatBox(anim1) outputChatBox(anim2) outputChatBox("anim: "..tostring(anim)) setPedAnimation(block1, anim2) end end end end addEventHandler("onClientGUITabSwitched", FanimsTab, whatever) anim1 outputs nil anim2 outputs space tostring(anim) outputs anim: thrw_barl_thrw Why doesn't anim2 output the text of gridlist item? How can I make it output it? Obviously there is no animation as well. test.xml: <test> <animation block="AIRPORT" animation="thrw_barl_thrw"></animation> </test>
  6. What about 'onClientHUDRender'?
  7. triggerServerEvent("onGUIPrivateMessage", getLocalPlayer(), ply,newText)
  8. ERROR: Client (username) triggered serverside event onGUIPrivateMessage, but event is not added serverside addEvent("onGUIPrivateMessage", true) addEventHandler("onGUIPrivateMessage", getRootElement(), function(toplayer, text) triggerClientEvent(toplayer, "onPrivateChatSent", source, source, text) end ) I added the event. Why does it say that it is not added?
  9. Will it lag for the player if I use too much onClientRender?
  10. Drakath

    Blocking

    Thank you all. It finally works!
  11. Drakath

    Blocking

    Removing break didn't help. EDIT: Yeah, I tested the code, it only reacts when I'm blocked but when I'm not, it doesn't do anything.
  12. Drakath

    Blocking

    I'm not missing any ends...
  13. Drakath

    Blocking

    function lolok(ply) local playername = getPlayerName(ply) for _,v in ipairs(blocked) do if v == playername then outputChatBox("block") break else outputChatBox("Message sent",255,255,255,true) end end end addEvent("xD", true) addEventHandler("xD", root, lolok) When player is blocked it outputs block as it should but if player is not blocked then nothing happens. Why?
  14. Drakath

    Blocking

    Saml1er, what if I block multiple players? I think your function will remove every blocked player and I want to remove only the player who is defined.
  15. Drakath

    Blocking

    I had this idea in mind but I'm not sure how will I make the unblock function. And about the tables, I have the blocked players names stored in a table by using table.insert but how do I check if player who sent the pm is in the table?
  16. Drakath

    Blocking

    pa3ck I said I don't want to use account data. Also I want to prevent them from sending a pm to a particular player, not everyone. Though I will try to do something with tables.
  17. Drakath

    Blocking

    It's not what I'm asking. I want to know how do I store the blocked players. I do not want to use account data.
  18. Drakath

    Blocking

    Can anyone give me an advice of how to make an ability to block a player, so he won't be able to send you a private message? function privateMessage(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if (getPlayerFromParticalName (sendToName)) then toPlayer = (getPlayerFromParticalName (sendToName)) if not (toPlayer == thePlayer) then if not (pmMessage == "") then outputChatBox("#FFFFFF[PM] Message to #ff9900" .. getPlayerName(toPlayer) .. "#FFFFFF: " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FFFFFF[PM] Message from #ff9900" .. getPlayerName(thePlayer) .. "#FFFFFF: " .. pmMessage, toPlayer, 255, 255, 255, true) else return false end else return false end else return false end else return false end end addCommandHandler("pm", privateMessage)
  19. Now I get: WARNING: Bad argument @ 'isGuestAccount' [Expected account at argument 1, got boolean] WARNING: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] ERROR: attempt to concatenate local 'accName' (a boolean value)
  20. There is no such thing in my mtaserver.conf
  21. I set the minimum client version to 1.3.5-0.00000 but when I turned on the Server it automatically set to 1.3.5-9.06162. Why?
×
×
  • Create New...