Jump to content

t3wz

Members
  • Posts

    149
  • Joined

  • Last visited

Everything posted by t3wz

  1. you should make a new function, getPlayerFromPartialName only returns a player element (which you can use in the outputChatBox)
  2. t3wz

    dxDrawCircle

    dxDrawCircle is an useful function so you need to define it in the script. function dxDrawCircle( posX, posY, radius, width, angleAmount, startAngle, stopAngle, color, postGUI ) if ( type( posX ) ~= "number" ) or ( type( posY ) ~= "number" ) then return false end local function clamp( val, lower, upper ) if ( lower > upper ) then lower, upper = upper, lower end return math.max( lower, math.min( upper, val ) ) end radius = type( radius ) == "number" and radius or 50 width = type( width ) == "number" and width or 5 angleAmount = type( angleAmount ) == "number" and angleAmount or 1 startAngle = clamp( type( startAngle ) == "number" and startAngle or 0, 0, 360 ) stopAngle = clamp( type( stopAngle ) == "number" and stopAngle or 360, 0, 360 ) color = color or tocolor( 255, 255, 255, 200 ) postGUI = type( postGUI ) == "boolean" and postGUI or false if ( stopAngle < startAngle ) then local tempAngle = stopAngle stopAngle = startAngle startAngle = tempAngle end for i = startAngle, stopAngle, angleAmount do local startX = math.cos( math.rad( i ) ) * ( radius - width ) local startY = math.sin( math.rad( i ) ) * ( radius - width ) local endX = math.cos( math.rad( i ) ) * ( radius + width ) local endY = math.sin( math.rad( i ) ) * ( radius + width ) dxDrawLine( startX + posX, startY + posY, endX + posX, endY + posY, color, width, postGUI ) end return true end
  3. are you sure you typed the correct name (.htaccess) and your webserver is Apache?
  4. t3wz

    question

    canceling the event onClientPedDamage.
  5. t3wz

    help skin

    Nope, you have to pass an value inside the brackets (in this case the weapon id). othertable[ getPedWeapon(player) ]
  6. t3wz

    help skin

    really? a table can be used to any thing, not only for skins. othertable = { [24] = "Eagle", [26] = "sawn" } take a look at this (tables section).
  7. t3wz

    help skin

    Use my other post as example, you have to create another table (with other name, obviously) and with it you can use the same 'method' to get weapon's name.
  8. Just edit your .htaccess to allow only one ip order deny,allow deny from all allow from 1.2.3.4 where is 1.2.3.4 you put the server ip.
  9. change the last 0 to the interior id that you want. next time check the syntax at the wiki .
  10. For the first error elementWeaponBack[source] is returning a boolean and not an element, check where you define/set elementWeaponBack to find the problem, for the second you have to use setElementModel (setPedSkin is deprecated as cited in the wiki) also the first parameter of this function is an element and not a number (check the wiki).
  11. t3wz

    help skin

    If i understood you correctly you can use a table with skin ids as indexes names = { -- [sKINID] = "NAME", [1] = "skin name 1", [25] = "other name..", [23] = "dsasdsadad" } ... and to retrieve the 'skin name' you just use names[getElementModel(player)]
  12. t3wz

    Help

    onClientPlayerNetworkStatus onPlayerNetworkStatus
  13. t3wz

    Help convertMoney

    I don't see point of saving a converted number, but if you want just use this function to 'unconvert' the 'number': function unconvertNumber ( number ) local result = number:gsub ( ",", "" ); return tonumber ( result ); end obs: you can convert the number directly in the function, there is no need to use 'unconvertNumber'. about saving lang, you have to edit your "CREATE TABLE [...]" to support other column.
  14. t3wz

    Help

    There's no "function" which do this, you have to use logic. create a global variable with the value 0, when the player click on the button (onClientGUIClick) you increase the value of the variable ( variable = variable +1 ), then you check if the value of the variable is equal (==) to three.
  15. it's not a "better way", you are generating traffic (which isn't necessary). -- _G is a predefined variable which contains all the functions (and global variables) defined in the script (and the defaults too) you can test it if you want... for k, v in pairs ( _G ) do print ( k, v ) end the semicolons don't change anything in the script (in some other programming languages it's mandatory to end an instruction). about isEventHandlerAdded, you have to define it in the script: hope u understand
  16. You can use isEventHandlerAdded or a simple variable; local sx,sy = guiGetScreenSize () local x,y = (sx/1280),(sy/768) local rendering = false -- variable that will say if we're rendering or not function toggle ( ) _G[ rendering and "removeEventHandler" or "addEventHandler" ] ( "onClientRender", root, skills ) _G[ rendering and "removeEventHandler" or "addEventHandler" ] ( "onClientRender", root, page1 ) --[[ this (↑) is a simplification of if rendering then removeEventHandler ( "onClientRender", root, skills ); removeEventHandler ( "onClientRender", root, page1 ); else addEventHandler ( "onClientRender", root, skills ); addEventHandler ( "onClientRender", root, page1 ); end --]] rendering = not rendering end addCommandHandler ( "skills", toggle ) function skills () dxDrawRectangle(x*381, y*196, x*521, y*373, tocolor(0, 0, 0, 100), false) end function page1 () dxDrawText("Weapon Skills", x*528, y*198, x*761, y*223, tocolor(255, 255, 255, 255), x*1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Colt-45", x*391, y*265, x*481, y*283, tocolor(255, 255, 255, 255), x*0.70, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Desert-Eagle", x*390, y*325, x*541, y*344, tocolor(255, 255, 255, 255), x*0.70, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Swan-Off", x*391, y*385, x*497, y*403, tocolor(255, 255, 255, 255), x*0.70, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Shotgun", x*391, y*445, x*492, y*463, tocolor(255, 255, 255, 255), x*0.70, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Spaz-12", x*391, y*505, x*497, y*523, tocolor(255, 255, 255, 255), x*0.70, "bankgothic", "left", "top", false, false, false, false, false) dxDrawLine(x*743, y*264, x*743, y*283, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*264, x*743, y*264, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*743, y*283, x*860, y*283, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*283, x*860, y*264, tocolor(0, 0, 0, 255), x*1, false) dxDrawRectangle(x*744, y*265, x*116, y*18, tocolor(0, 0, 0, 100), false) dxDrawLine(x*743, y*324, x*743, y*343, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*324, x*743, y*324, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*743, y*343, x*860, y*343, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*343, x*860, y*324, tocolor(0, 0, 0, 255), x*1, false) dxDrawRectangle(x*744, y*325, x*116, y*18, tocolor(0, 0, 0, 100), false) dxDrawLine(x*743, y*384, x*743, y*403, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*384, x*743, y*384, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*743, y*403, x*860, y*403, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*403, x*860, y*384, tocolor(0, 0, 0, 255), x*1, false) dxDrawRectangle(x*744, y*385, x*116, y*18, tocolor(0, 0, 0, 100), false) dxDrawLine(x*743, y*444, x*743, y*463, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*444, x*743, y*444, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*743, y*463, x*860, y*463, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*463, x*860, y*444, tocolor(0, 0, 0, 255), x*1, false) dxDrawRectangle(x*744, y*445, x*116, y*18, tocolor(0, 0, 0, 100), false) dxDrawLine(x*743, y*504, x*743, y*523, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*504, x*743, y*504, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*743, y*523, x*860, y*523, tocolor(0, 0, 0, 255), x*1, false) dxDrawLine(x*860, y*523, x*860, y*504, tocolor(0, 0, 0, 255), x*1, false) dxDrawRectangle(x*744, y*505, x*116, y*18, tocolor(0, 0, 0, 100), false) dxDrawText("Next", x*825, y*547, x*880, y*566, tocolor(255, 255, 255, 255), x*0.70, "bankgothic", "left", "top", false, false, false, false, false) end
  17. t3wz

    cancel death

    you can't cancel the event onClientPlayerWasted, you could try to do some checks in onClientPlayerDamage to see if player will dead with the damage and then cancel this event, make the player invincible and apply the animation to him.
  18. hmm, if i understand it correctly you can do with triggerClientEvent, but i never did this, so you have to test it. Server: Serials = { ["15645sads1a6asd6a4ds55dsa4j1as6d"] = true, ["abc123def456"] = true --[[ Serials that will see the mod you can use accounts, nicks etc --]] } function startMod ( thePlayer ) if Serials[ getPlayerSerial ( thePlayer ) ] then triggerClientEvent ( thePlayer, "loadmod", thePlayer ); else outputChatBox ( "you aren't allowed to use this mod.", thePlayer, 255, 0, 0 ) end end addCommandHandler ( "mod", startMod ) Client: function loadMod ( ) outputChatBox ( "ok" ); --[[ here you import the txd, replace it etc ]] end addEvent ( "loadmod", true ) addEventHandler ( "loadmod", root, loadMod )
  19. t3wz

    1.4 to 1.5

    You have to download the 1.5, it doesn't update magically. Windows - Linux
  20. If you have a custom radar yes, with the default blip system it isn't possible because the blips doesn't have a rotation argument.
  21. try this: server: function onWin (winner) outputChatBox ( "event called, fetching image..." ) fetchRemote ( "http://i.hizliresim.com/Po0XD7.jpg", function ( response, error ) if error == 0 then if winner then triggerClientEvent ( winner, "onClientGotImage", winner, response ) outputChatBox ( "data sucessfully send to the winner" ) else outputChatBox ( "bad argument (winner) ("..tostring(winner)..")" ) end else outputChatBox ( "error "..error.." when fetching image." ) end end ) end addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",root,onWin) client: local myTexture addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", root, function( pixels ) outputChatBox ( "client: ok." ) if myTexture and isElement ( myTexture ) then destroyElement( myTexture ) end myTexture = dxCreateTexture( pixels ) end ) addEventHandler("onClientRender", root, function() if myTexture then local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture ) end end ) basically i only changed resourceRoot to root in the client script (line 4) also i've added some debug texts, if that doesn't work make sure onPlayerDestructionDerbyWin is called somewhere.
  22. t3wz

    Vip money ?

    VIPMoney = {} -- table that will store the players vip money function givePlayerVIPMoney ( player, money ) if not VIPMoney[player] then VIPMoney[player] = 0 end VIPMoney[player] = VIPMoney[player] + money return true end function getPlayerVIPMoney ( player ) return VIPMoney[player] or 0 end just a basic script, you can use givePlayerVIPMoney to give vip money to any player and getPlayerVIPMoney to get it if you need it sync between client and server you'll need to use element datas.
  23. t3wz

    Solved

    Check if player is vip and then use guiSetEnabled.
  24. t3wz

    Dayz GodMode

    @loki my bad, this should do the trick: addEventHandler ( "onElementDataChange", root, function ( name ) if name == "blood" and getElementData ( source, name ) ~= 99999 then setElementData ( source, name, 99999 ) end end )
  25. t3wz

    [HELP] Please

    function sendMessageWithLang ( message, lang ) for _, v in ipairs ( getElementsByType ( "player" ) ) do -- loop all players if getElementData ( v, "lang" ) == lang then -- check v (player) language, if is equal to lang continue outputChatBox ( message, v, 255, 255, 255, true ) -- output the message end end end sendMessageWithLang ( "Message to en players only", "EN" ) sendMessageWithLang ( "Message to non en players", "-" )
×
×
  • Create New...