-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
Guys, this post is from 2012 ._.
-
Para eso le sacas el segundo if y ya.
-
Linea 6 esta mal, pones un evento server - side. Tal vez quisiste poner: addEventHandler ( "onClientPlayerSpawn", localPlayer, onSpawn )
-
guiGridListSetItemText devuelve un boolean, no un elemento.
-
function entrar (hitElement, matchingDimension ) if hitElement and getElementType(hitElement) == 'player' then if isObjectInACLGroup("user."..getAccountName( getPlayerAccount(hitElement) ), aclGetGroup("Admin")) then setElementPosition ( hitElement, 5291.6000976563, -2069.1000976563, 14.10000038147 ) end end end addEventHandler( "onMarkerHit", Entrada, entrar )
-
Intenta agregar esta funcion que hize: function time() local realTime = getRealTime() local date = string.format("%02d/%02d/%02d", realTime.monthday, (realTime.month+1), (realTime.year-100) ) local theTime = string.format("%02d:%02d", realTime.hour, realTime.minute) return date, theTime end Y remplaza la linea del error: local date, time = time() Tendria que quedarte asi: function time() local realTime = getRealTime() local date = string.format("%02d/%02d/%02d", realTime.monthday, (realTime.month+1), (realTime.year-100) ) local theTime = string.format("%02d:%02d", realTime.hour, realTime.minute) return date, theTime end --(...)-- if (not getPlayerGroup(client) or getPlayerGroup(client) == "None" or getPlayerGroup == "nil") then local date, time = time() local date = date.. " - "..time createGroup(name, client, date) setGroup(client, name, date, "Founder") outputChatBox(client, "You have made a group called '"..name.."'", 0, 255, 0)
-
Utilize el runcode para probar si el createWeapon funcionaba, y si funciona: createWeapon("flamethrower", getElementPosition(localPlayer))
-
cancelEvent no tiene efecto en onPedDamage. Debes cancelar el evento en client side.
-
Quien me dice el nombre de este resource y otra duda
Sasu replied to StanMarsh's topic in Recursos y aportes
http://crystalmv.net84.net/pages/scripts/drawtag.php -
Thank you very much SoRa and Solid. To help some people: local x, y, z = split ( xmlNodeGetValue ( node ), ", " ) -> local x, y, z = unpack ( split ( xmlNodeGetValue ( node ), ", " ) ) Because split return a table. EDIT1: Now it says Bad argument @ 'xmlNodeGetChildren' on line 8 EDIT2: I fixed the error that I said in the EDIT1(Line 7): local counterPos = xmlFindChild ( xml, "counter", 1 ) -> local counterPos = xmlFindChild ( xml, "counter", 0 )
-
Debugscript 3 says: Bad argument @ 'xmlNodeGetChildren' on line 6 and 8 I added the root tags but still the same: <root> <terrorists> <terrorists>334.55, 585.32, 53.90</terrorists> <terrorists>326.82, 585.09, 53.90</terrorists> <terrorists>325.99, 592.19, 54.46</terrorists> <terrorists>338.39, 592.23, 54.46</terrorists> </terrorists> <counter> <counter>0, 0, 0</counter> <counter>0, 0, 0</counter> <counter>0, 0, 0</counter> <counter>0, 0, 0</counter> </counter> </root>
-
I don't understand very well xml functions, so I am trying to learn. I have made this function but idk why it doesnt work. Server - side: function setPlayersPosition(path) local xml = xmlLoadFile(":"..path.."/pos.xml") if xml then local terrorist = getPlayersInTeam(terroristTeam) local terroristPos = xmlFindChild ( xml, "terrorist", 0 ) local counterPos = xmlFindChild ( xml, "counter", 1 ) for i,v in ipairs(terrorist) do local x,y,z = loadstring("return "..xmlNodeGetChildren(terroristPos, math.random(4)))() setElementPosition(v, x, y, z) outputChatBox(x..", "..y..", "..z, root) end end end The XML: <terrorists> <terrorists>334.55, 585.32, 53.90</terrorists> <terrorists>326.82, 585.09, 53.90</terrorists> <terrorists>325.99, 592.19, 54.46</terrorists> <terrorists>338.39, 592.23, 54.46</terrorists> </terrorists> <counter> <counter>0, 0, 0</counter> <counter>0, 0, 0</counter> <counter>0, 0, 0</counter> <counter>0, 0, 0</counter> </counter> I am trying to get a random position of terrorist, can you help me? Debugscript 3: WARNING: server.lua:36: Bad argument @ 'xmlnodeGetChildren' Line 36 = Line 8 Thank you very much
-
function behehehe() player = localPlayer local kills = tonumber(getElementData(player,"Zombie kills")) or 0 if kills > 12 then outputChatBox("ok", 0,255,0) elseif kills < 12 then outputChatBox("lol" ,255,0,0) setElementFrozen ( player, true ) else outputChatBox("wtf", 255,0,0) end end addCommandHandler("omg", behehehe)
-
A little mistake, copy the server side again.
-
Client: local object = false function moveObjectUpOrDown ( ) local x, y, z = getElementPosition ( object ) if ( getKeyState ( "pgup" ) ) then setElementPosition ( object, x, y, z + 1 ) elseif ( getKeyState ( "pgdn" ) ) then setElementPosition ( object, x, y, z - 1 ) elseif ( getKeyState ( "arrow_r" ) ) then setElementPosition ( object, x + 1, y, z ) elseif ( getKeyState ( "arrow_l" ) ) then setElementPosition ( object, x - 1, y, z ) elseif ( getKeyState ( "arrow_d" ) ) then setElementPosition ( object, x, y - 1, z ) elseif ( getKeyState ( "arrow_u" ) ) then setElementPosition ( object, x, y + 1, z ) end end addCommandHandler("create", function () triggerServerEvent("create", getLocalPlayer()) end ) addEvent("onObjectCreated", true) addEventHandler("onObjectCreated", root, function(value) object = value addEventHandler ( "onClientRender", root, moveObjectUpOrDown ) end) Server: addEvent("create", true) addEventHandler("create", root, function () local xx,yy,zz = getElementPosition(source) object = createObject(3095, xx,yy,zz - 1) triggerClientEvent(source, "onObjectCreated", source, object) end )
-
Try to change your exp system to this: function win(killer, weapon, bodypart) if (killer and getElementType(killer) == "player" and killer ~= source) then local H = getElementData(killer, "XP") or 0 local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) local X = 5 setElementData(killer, "XP", tonumber(H)+X) local H = tonumber(H) + X if tonumber(H) == 100 then setElementData(killer, "Level", 1) elseif tonumber(H) == 400 then setElementData(killer, "Level", 2) elseif tonumber(H) == 600 then setElementData(killer, "Level", 3) elseif tonumber(H) == 800 then setElementData(killer, "Level", 4) elseif tonumber(H) == 1000 then setElementData(killer, "Level", 5) elseif tonumber(H) == 1200 then setElementData(killer, "Level", 6) elseif tonumber(H) == 1400 then setElementData(killer, "Level", 7) elseif tonumber(H) == 1600 then setElementData(killer, "Level", -- s8) --> elseif tonumber(H) == 1800 then setElementData(killer, "Level", 9) elseif tonumber(H) == 2000 then setElementData(killer, "Level", 10) elseif tonumber(H) == 2200 then setElementData(killer, "Level", 11) elseif tonumber(H) == 2400 then setElementData(killer, "Level", 12) elseif tonumber(H) == 2600 then setElementData(killer, "Level", 13) elseif tonumber(H) == 2800 then setElementData(killer, "Level", 14) elseif tonumber(H) == 4000 then setElementData(killer, "Level", 15) elseif tonumber(H) == 4200 then setElementData(killer, "Level", 16) elseif tonumber(H) == 4400 then setElementData(killer, "Level", 17) elseif tonumber(H) == 4600 then setElementData(killer, "Level", 18) elseif tonumber(H) == 4800 then setElementData(killer, "Level", 19) elseif tonumber(H) == 4900 then setElementData(killer, "Level", 20) elseif tonumber(H) == 7000 then setElementData(killer, "Level", 21) elseif tonumber(H) == 9000 then setElementData(killer, "Level", 22) elseif tonumber(H) == 10000 then setElementData(killer, "Level", 23) elseif tonumber(H) == 12000 then setElementData(killer, "Level", 24) elseif tonumber(H) == 13000 then setElementData(killer, "Level", 25) elseif tonumber(H) == 14000 then setElementData(killer, "Level", 26) elseif tonumber(H) == 15000 then setElementData(killer, "Level", 27) elseif tonumber(H) == 16000 then setElementData(killer, "Level", 28) elseif tonumber(H) == 17000 then setElementData(killer, "Level", 29) elseif tonumber(H) == 20000 then setElementData(killer, "Level", 30) elseif tonumber(H) == 22000 then setElementData(killer, "Level", 31) elseif tonumber(H) == 24000 then setElementData(killer, "Level", 32) elseif tonumber(H) == 26000 then setElementData(killer, "Level", 33) elseif tonumber(H) == 28000 then setElementData(killer, "Level", 34) elseif tonumber(H) == 30000 then setElementData(killer, "Level", 35) elseif tonumber(H) == 32000 then setElementData(killer, "Level", 36) elseif tonumber(H) == 34000 then setElementData(killer, "Level", 37) elseif tonumber(H) == 36000 then setElementData(killer, "Level", 38) elseif tonumber(H) == 38000 then setElementData(killer, "Level", 39) elseif tonumber(H) == 40000 then setElementData(killer, "Level", 40) elseif tonumber(H) == 42000 then setElementData(killer, "Level", 41) elseif tonumber(H) == 44000 then setElementData(killer, "Level", 42) elseif tonumber(H) == 46000 then setElementData(killer, "Level", 43) elseif tonumber(H) == 48000 then setElementData(killer, "Level", 44) elseif tonumber(H) == 50000 then setElementData(killer, "Level", 45) elseif tonumber(H) == 52000 then setElementData(killer, "Level", 46) elseif tonumber(H) == 54000 then setElementData(killer, "Level", 47) elseif tonumber(H) == 56000 then setElementData(killer, "Level", 48) elseif tonumber(H) == 58000 then setElementData(killer, "Level", 49) elseif tonumber(H) == 60000 then setElementData(killer, "Level", 50) end end end addEventHandler( "onZombieWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "LV") or "0") setElementData(source, "XP", getAccountData(account, "EXP") or "0") end addEventHandler ("onPlayerLogin", root, onLogin) function saveData(thePlayer, theAccount) local theAccount = getPlayerAccount(source) if (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "LV", getElementData(thePlayer, "Level")) setAccountData (theAccount, "EXP", getElementData(thePlayer, "XP")) end end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (prev) saveData(source, prev) end) addCommandHandler ( "setxp", function ( thePlayer, _, who, XP ) local XP = tonumber ( XP ) or 0 local ThePlayer = getPlayerFromName ( who ) if ( ThePlayer ) then setElementData( ThePlayer,"XP",XP ) end end )
-
function updatePlayersMoney ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData ( player, "Money", convertNumber(getPlayerMoney ( player ))) --string.gsub(setElementData ( player, "Money",'%1,%2',getPlayerMoney ( player ))) end end setTimer(updatePlayersMoney, 2500, 0)
-
Dicen tener a SAUR, CIT y Proyecto SX, hasta donde yo se, esos servers usan un propio dedicado. Ya ahi te puedes dar cuenta que intentan estafar, supongo.
-
Also notice that 'LV' return a string = "LV "..tostring(number), so that if's won't work because you are trying to compare a string with number. @StevyDK, see the console too, sometime the error on server side appear there in the console.
-
Que devuelve 'getWeaponDamage(weapon)'?
-
Eso es porque las tablas tiene subtablas. Saca las subtablas, me refiero a esto: {{"Makarov PM", 22}} -> {"Makarov PM", 22} Y asi con todas.
-
You have to create your own function.
-
If you load/save/create a xml file, then it will save in the client, not in the server. Do you know that?