Scripting
Members-
Posts
109 -
Joined
-
Last visited
Everything posted by Scripting
-
Hi all, I have a bug if i do this: client-side: name1 = guiCreateLabel(50,10,410,20,"test1",true) name2 = guiCreateLabel(50,25,410,20,"test2",true) money1 = guiCreateLabel(300,10,410,20,"20000",true) money2 = guiCreateLabel(300,25,410,20,"17000",true) function show () local playerMoney = getPlayerMoney(getLocalPlayer()) local name = getPlayerName(getLocalPlayer()) if ( playerMoney >= tonumber (guiGetText(money1)) ) then guiSetText(name2,guiGetText(name1)) guiSetText(name1,"The Name: ".. name) guiSetText(money2,guiGetText(money1)) guiSetText(money1,"The Money: ".. PlayerMoney) [This Change] end end addEventHandler("onClientRender", getRootElement(), show) The Code work Correctly 100%; and if I change this Code Argument : guiSetText(money1,"The Money: ".. PlayerMoney) The Code work a bug: The Label(money1,mney2) change text to (playerMoney) and the Label(name1,name2) change text to (name). Pls fix this bug set The Code work Correctly: client-side: name1 = guiCreateLabel(50,10,410,20,"test1",true) name2 = guiCreateLabel(50,25,410,20,"test2",true) money1 = guiCreateLabel(300,10,410,20,"20000",true) money2 = guiCreateLabel(300,25,410,20,"17000",true) function show () local playerMoney = getPlayerMoney(getLocalPlayer()) local name = getPlayerName(getLocalPlayer()) if ( playerMoney >= tonumber (guiGetText(money1)) ) then guiSetText(name2,guiGetText(name1)) guiSetText(name1,"The Name: ".. name) guiSetText(money2,guiGetText(money1)) guiSetText(money1,playerMoney) [This The Change Arguments ] end end addEventHandler("onClientRender", getRootElement(), show)
-
Yea Solidsnake14 thx verry much for help!
-
Pls fix that Code don t work!! client-side: name1 = guiCreateLabel(50,10,410,20,"",false,tab) function join () function join () triggerServerEvent ( 'load', source) end addEventHandler("onClientPlayerJoin", getRootElement(), join) server-side: addEvent("load",true) addEventHandler( "load",root, function() loadxml = xmlLoadFile("score.xml") if loadxml then score1 = xmlFindChild(file,"flos1",0) find1 = xmlNodeGetValue(score1) triggerClientEvent ( 'loadClient', source,find1 ) end end ) client-side: addEvent("loadClient",true) addEventHandler("loadClient",root, function(find1) place = tonumber(find1) guiSetText(name1,place) end )
-
Solidrsnake I have a exemple, if i want save the money of the players in a xml file, server-side: addEventHandler(onPlayerQuit,root, function () money = getPlayerMoney(source) how i can save the money in a one Child??!
-
Ok my exemple that work?? the xml file: 60 60 tab 1 in client-side: function ClientResourceStart () text1 = guiGetText(edit1) xmlRootTree = xmlLoadFile ( "userSettings.xml" ) if xmlRootTree then xmlNodeSetValue (xmlCreateChild ( xmlHudBranch, "IconSizeX"), "" .. text1 .. "" ) end addEventHandler ( "onClientResourceStart", root, ClientResourceStart )
-
Man I m bad in Xml Files,Can give me a help, how i can in "xmlLoadFie" get a text
-
]I can use other code for Xml Files to save a text? if can tell me pls how! Contunie my exemple
-
Hi All, I want ask how i can use Xml Files for Load and Save text in it. exemple: text1 = guiGetText(edit) xmlLoadFile("xml1") how i can save the text1 in xml file 1 and Save it and thx .
-
Hi People, I m set this code: for id, player in ipairs ( getElementsByType ( "player" ) ) do To drawe Text to all players when I Command, but don t work! Pls fix that and thx client-side: function onCommand() function draw () sWidth, sHeight = guiGetScreenSize() find = "The Word: Welcome!" dxDrawText(tostring (find),sWidth-700,sHeight-200,sWidth-350,sHeight-100,tocolor(255,255,0),1.0,"bankgothic","right","top",false,false,false) -- Money DX text end addEventHandler("onClientRender", getRootElement(), draw) end addCommandHandler ( "drawWel",onCommand)
-
Hi People, I ask if I can set a code work in the resource start and don t work in the player join, for Exemple setTimer(function() outputChatBox("ResourceStarted") I can set This writed in Chat just in Resource Start and don t write it in the Player Join and thx info: [Client-side]
-
tiggerClientEvent don t work! server-side: addEventHandler("onResourceStart",root, function () triggerClientEvent ( 'startTheClient',source ) end )
-
I want ask if I can do that: set a name to weapon server side: super = giveWeapon(source,31,1000) function detect(player,weapon,super) if ( weapon == "m4" ) then killPed(player) outputChatBox("Don t use Super Weapon",player,255,255,0,true) end end addEventHandler(onPlayerFire,getRootElement(),detect)
-
Hi people, addEventHandler("onMarkerHit" don t work, pls fix it server side: addEventHandler( "onMarkerHit", marker1, hit1 ) marker1 = createMarker ( 1866.4461669922, -1842.089984375,388.32568359375 , 'cylinder', 2.0, 255, 0, 0, 150) function hit1 (player) outputChatBox("hited")
-
Wtf what s you changed??!
-
There is a command in "BaseMode" Game just fix that
-
excuteCommandHandler don t work!! server-side: addEvent("addin",true) addEventHandler("addin",root, function() outputChatBox("Command [spawn] to add you in game",source,0,255,0,true) addCommandHandler("spawn", function (player) local ID = getElementData (player, "ID") executeCommandHandler("add", player, ID) outputChatBox("You Spawned",source,0,255,0,true) removeCommandHandler("spawn") end ) end )
-
I m making a commang to excute a another command but he don t dork?can fix that and thx server-side: addCommandHandler("spawninmap", function () local ID = getElementData (source, "ID") executeCommandHandler("vote"" .. ID .. ") outputChatBox("You spawned",source,255,255,0,true) end )
-
Hi People, pls i want fix Client-side don t work!! server-side: addCommandHandler ("give", function (element) local x, y, z = getElementPosition(element) local shield = createObject(1337, x, y, z) local shield2 = createObject(1337, x, y, z) attachElements(shield, element, 0, 1, 0) attachElements(shield2, element, 0, 1, 0.2) triggerClientEvent("rep",source) end ) client-side: addEvent("rep",true) addEventHandler("rep",root, function() txd = engineLoadTXD ( "sh/riot_shield.txd" ) engineImportTXD ( 1337, 587 ) dff = engineLoadDFF ( "sh/riot_shield.dff", 587 ) engineReplaceModel ( dff, 1337 ) col_floors = engineLoadCOL ( "sh/riot_shield.col" ) engineReplaceCOL ( col_floors, 1337 ) end )
