Jump to content

Z4Zy

Members
  • Posts

    215
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Z4Zy

  1. Client Side :- GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(563, 204, 519, 491, "Rules and Regulation", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 29, 500, 418, "", false, GUIEditor.window[1]) button1 = guiCreateButton(18, 449, 491, 32, "I agree", false, GUIEditor.window[1]) end ) function closeButton() if source == button1 then outputChatBox("Hey") end end addEventHandler("onClientGUIClick", resourceRoot, closeButton) Or , Client Side :- GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(563, 204, 519, 491, "Rules and Regulation", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 29, 500, 418, "", false, GUIEditor.window[1]) button1 = guiCreateButton(18, 449, 491, 32, "I agree", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", button1, closeButton) end ) function closeButton() outputChatBox("Hey") end
  2. Server Side Script line 14 replace 1st argument of "triggerClientEvent" to player and 3rd to resourceRoot
  3. yeah... it should be in client side. As DX functions are client only.
  4. for what side did you add this event ?? client or server ??
  5. I've missed that option. Thank You very Much..!!
  6. what about this ? addEventHandler("onPlayerWasted", root, function () if ( getElementModel(source) == 0 ) then setElementData(source,"CJ",true) else setElementData(source,"CJ",false) end end ) addEventHandler("onPlayerSpawn", root, function () if ( getElementData(source,"CJ") == true ) then setElementModel(source, 0) end end )
  7. Didn't you want to do that, when player dies and spawn, that player's skin should CJ skin not another. Isn't it ??
  8. When player be with CJ skin before die , it is no need to set player's skin to CJ skin when player die. Use, "onPlayerSpawn" event to set the player's skin to 0 / CJ skin Server Side :- addEventHandler("onPlayerSpawn", root, function () setElementModel ( source, 0 ) end ) I think this will be usefull.
  9. Z4Zy

    Fix a code.

    Try this out. May be it'll good. function event () local Time1 = 50 for _,all in ipairs ( getElementsByType("player") ) do outputChatBox( "Event Will Started In 60 Minutes. #ff0000TimeLeft:- #00ff0060 Minutes", all, 255, 255, 0, true ) end eventTimer = setTimer( function() if Time1 > 0 then for _,all in ipairs ( getElementsByType("player") ) do outputChatBox("The event will start every one hour once. TimeLeft: "..Time1.." Minutes", all, 0, 255, 0) end Time1 = Time1 - 10 else for _,all in ipairs ( getElementsByType("player") ) do outputChatBox("Event Started !", all, 255, 255, 0) end killTimer(eventTimer) end end, 600000, 0 ) end addEventHandler("onResourceStart",resourceRoot,event)
  10. oh No Big Mistake..!! Wrong word I can't edit it. No edit option. All the "font" should be "front". I mean, create a GUI Window, front of a DX image How to do that ??
  11. well @monamour This is the "onPlayerChat" event in fr_server.lua addEventHandler('onPlayerChat', root, function(msg, type) if type == 0 then cancelEvent() if chatTime[source] and chatTime[source] + tonumber(get("*chat/mainChatDelay")) > getTickCount() then outputChatBox("Stop spamming main chat!", source, 255, 0, 0) return else chatTime[source] = getTickCount() end if get("*chat/blockRepeatMessages") == "true" and lastChatMessage[source] and lastChatMessage[source] == msg then outputChatBox("Stop repeating yourself!", source, 255, 0, 0) return else lastChatMessage[source] = msg end local r, g, b = getPlayerNametagColor(source) outputChatBox(getPlayerName(source) .. ': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), root, r, g, b, true) outputServerLog( "CHAT: " .. getPlayerName(source) .. ": " .. msg ) end end ) Did you see ?? there's a cancelEvent () . It means when player chat, that event will cancel, then customize the message and output. If there wasn't cancelEvent() chat goes double. That's the trouble i have. Now resolved. Anyway Thank you!.
  12. Hellow..!! After creating a DX image [ image created using "dxDrawImage" function ], can a GUI Window set font of that DX image ?? And how ?? [ i think "guiSetFont" function is not useful in this occasion. Because I tested it :3 ]
  13. Like This ?? Server Side :- addEventHandler("onColShapeHit",yourColName, function (player) setElementData(player,"inCol",true) end ) addEventHandler("onColShapeLeave",yourColName, function (player) setElementData(player,"inCol",false) end ) setTimer( function () for _,Player in ipairs ( getElementsByType("player") ) do if ( getElementData(Player,"inCol") == false ) then setElementHealth(Player,getElementHealth(Player)-20) end end end,1000,1) Replace "YourColName" with your col shape's name.
  14. The code must be insert to client side. And try to insert below code into the script. local dot = dxCreateTexture(1,1) local white = tocolor(255,255,255,255) function dxDrawRectangle3D(x,y,z,w,h,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, dot, h, c or white, ...) end
  15. @KingBC Try this out. Server Side :- addEventHandler("onPlayerJoin", getRootElement(), function () fadeCamera(source,false) end ) addEventHandler("onPlayerLogin", root, function () fadeCamera(source,true) end ) When player join to the server, that player's camera will fade out. When he logged in, camera come back to normal. According to the "fadeCamera" theory... 50% faded = 50% volume, full fade = no sound.
  16. aren't there any alternative way to fix that code ??
  17. aahh... I've tried that thing.., but I couldn't see any change in the arrow. it remains downward.
  18. I created another code that create 2 objects as, 1st is vehicle 587 and 2nd is pickup 1318. And apply a function that exist "findRotation3D" function, to rotate the car faced to pickup's direction. As Follows, Client Side :- local object1 = createVehicle( 587, 2.67369, 23.92969, 3 ) local object2 = createObject( 1318, 0, 0, 4 ) addEventHandler("onClientResourceStart",resourceRoot, function () local x1, y1, z1 = getElementPosition( object1 ) local x2, y2, z2 = getElementPosition( object2 ) local rx, ry, rz = findRotation3D( x1, y1, z1, x2, y2, z2 ) setElementRotation( object1, rx, ry, rz ) end ) This code works fine. Means, the car is facing to the pickup's direction successfully. This code and previous code, both are created on client side. Why is my previous code does not worked ?? is the problem in pickups ?? i need to make that previous code work. Help me to fix previous code. Please Help...!!
  19. first, thank you @Dzsozi (h03) for mentioned the functions to me. And I created a simple code using "findRotation3D". That code does not function successfully. Code mentioned bellow. local object = createObject( 1318, 0, 0, 0 ) addEventHandler("onClientRender",getRootElement(), function () local px, py, pz = getElementPosition(getLocalPlayer()) local rx, ry, rz = findRotation3D( px, py, pz, 0, 0, 2 ) local ax, ay, az = getElementPosition(getLocalPlayer()) setElementRotation( object, rx, ry, rz ) setElementPosition( object, ax, ay, az + 2 ) end ) The "object" is always present in player's Z co-ordinate + 2. But, it's rotation is malfunctioning. Means, the object's rotation is not rx, ry, rz. What is the reason for that ?? What's the wrong in code ??
  20. @50cent Did you mean to create a text inside the MTA:SA world ?? If so, You can try below resource. https://community.multitheftauto.com/index.php?p=resources&s=details&id=3090
  21. Hi guys..!! Now I am finding a way, how to create an arrow [ "Down arrow" pickup :- 1318 ] that every-time targeting one position. Like... there is an arrow on player's head and it leads the player to reach a position. So that arrow always target one position. What should i do to set the arrow's target to one position ?? Can you help me ??
  22. @Falk Just use "col editor 2" to convert your .cst file to .col file. [ that is mentioned in the TUT sweetly ] Download Col Editor 2 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ My Problem :- Alright, first Thank You very much @Bussy-E for your great TUT....!!! Alright, i follow your steps of videos in TUT yes, and i have create a BOX. Alright, And i add it into the server and start the resource alright?. The object 2052 has been changed to a BOX shape, yes. But, only 3 sides are only seen in that BOX alright. The other 3 sides were missed Yes.... So,,, What should i do to visible that missed 3 faces of the BOX ?? and i recognised that the problem is in .DFF file of the object. How to fix this ?? [ Please Anyone Help Me ..!!! ]
  23. in every 2 seconds, admin's health should decrease by 5%. Can you fix below wrong code function decrease ( ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) for _,p in pairs(getElementsByType ( "player" )) do if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementHealth ( thePlayer, getElementHealth(thePlayer) - 5 ) end end end setTimer ( decrease, 2000, 0 )
  24. Hi Again.... in client side of the LUA script, we could done like below, local player = getLocalPlayer () then the word player is equal to the "local player's" specifications. But in server side.... it couldn't done, because getLocalPlayer () is a client side event. So what is the way of enter it in to the server side ??
  25. when a player hit the colshape fr_gui should unbind...!! but it doesn't happens
×
×
  • Create New...