Jump to content

Sisqo0

Members
  • Posts

    78
  • Joined

  • Last visited

Posts posted by Sisqo0

  1. Features:-

                       *Creating custom bases as you want for each kind of base.

                    *Stopping/Running it without deleting it.

                    *Warping to any base.

                    *Control all vehicles in the base ( blow & fix & warp it to you & kick it out of base & editing vehicle's inventory ).

                    *Control all tents in the base ( destroy & editing tents' inventory by taking and giving items ).

                    *Spectating mode with 2 cameras to see everything in the base at your position.

                    *Changing ( the group name of base & the maximum vehicles ).

                    *Limitation of the duration so the base will be deleted after the duration.

                    *Limitation offline time so the base will be deleted if no one of the group entered the base within that time.

                    *Password for each base and can be toggled off/on by group members only ( 'password' = allow strangers to enter base by password & 'off' = strangers can't enter and can't see password window ). Note:- group members & admins don't need a password to enter the base even if the password was toggled on ( only strangers ).

                    *Map for all bases and you can go to the base by double-left-click & know details of the base by clicking right-click ( Red for paid bases & Green for free bases ).

                    *Deleting the base.

                    *information to know last entry time ( counts entry of group members only not admins or strangers ) & owner & size of base & number of vehicles and storage items.

                   *Database to save bases after restarting the resource.

    Note :-

                    *Owner ( members ) label needs to be linked with your group resource to get the owner of the group ( i would help you if you couldn't do that ).

                  *I'm bad mapper and even I made the free small base & paid medium base have the same base, it's easy to edit settings.lua ( i would help you too if you had custom bases and couldn't add them ).

    If you wanna buy it via paypal then send me a message here or on discord -->> Sisqo#0103

    Images :-  Click here

    --settings.lua
    BaseSize = {
          ["free"] = {
                        -- warpInX,warpInY,warpInZ,markerInBaseX,markerInBaseY,markerInBaseZ,colShapeX,colShapeY,colShapeZ,colShapeWidth,colShapeDepth,colShapeHeight,MaxVehicles
                 ["small"] = {-1308.14453125,2473.8813476563,87.26789855957,-1288.8851318359,2458.0390625,86.5,-1344.76318,2448.81323,83.82028,68.918090820313,56.2080078125,15.474256896973,2},
                 ["medium"] = {},
                 ["big"] = {}
          },
          ["paid"] = {
                 ["small"] = {},
                 ["medium"] = {1496.0118408203,2850.5422363281,10.87656211853,1521.8402099609,2831.6010742188,10,1465.16125,2825.26978,8,68.106201171875,56.50341796875,15,3},
                 ["big"] = {}
          }
    }
    
    CustomBase = {
          ["free"] = {
                     --model,posX,posY,posZ,rotX,rotY,rotZ
                 ["small"] = {
                      {8378,-1310.09,2449.8,87.59,0,0,0},
                      {3816,-1310.1,2476.7,94.7,0,0,0},
                 },
                 ["medium"] = {
                      {},
                 },
                 ["big"] = {
                      {},
                 }
          },
          ["paid"] = {
                 ["small"] = {
                      {},
                 },
                 ["medium"] = {
                      {3816,1498.9,2853.3999,18.4,0,0,0},
                      {8378,1499.3,2825.8,19.6,0,0,0},
                 },
                 ["big"] = {
                      {},
                 }
          }
    }
    
    BaseInfo = {
          ["free"] = {
                          --camera1X,camera1Y,camera1Z,camera2X,camera2Y,camera2Z,pickupX,pickupY,pickupZ
                 ["small"] = {-1334.1291503906,2454.4438476563,94.238426208496,-1287.4936523438,2499.5974121094,94.881118774414,-1284.8393554688,2501.4360351563,87.18229675293},
                 ["medium"] = {},
                 ["big"] = {}
                 },
          ["paid"] = {
                 ["small"] = {},
                 ["medium"] = {1521.2963867188,2876.2236328125,16.732257843018,1474.8344726563,2830.5341796875,16.91400718689,1524.0460205078,2878.3322753906,10.882294654846},
                 ["big"] = {}
                 }
    }
  2. This problem is weird for me. it's my first time to face this problem. i started my local server without editing mtaserver.conf and i saw that ase is set to '1' but i can't see the server in local list. when i press info button ,i get the server info and can enter the server by pressing 'connect' (mtasa://127.0.0.1:22003). i want my 2nd PC to log in server but it's not shown and can't join with my IP of 1st PC  .. all my ports is closed but it's not the reason because all ports of my 2nd PC are closed too and the server can be seen to both them in local list.

  3. Third :-

    if there is a function which was attached to event and you call it a lot in the same and other side (client or server) ,would it be better if we just call the function in the same side by its name or using this :-

    triggerEvent("function-name")

     

  4. First :-

    I wanna know, what is the best way to save table in element data ? i know 2 ways only but if there are more and better than those, i hope you tell me

    --1st way >> table {}
    setElementData(player,"data",{x,y,z})
    
    --2nd way >> toJSON
    setElementData(player,"data",toJSON(x,y,z))

    Second :-

    What's the best way to extract variables from table. I know 3 ways but i don't know which one is the best 

    --1st way >> unpack()
    setElementData(player,"data",{x,y,z})
    local data = getElementData(player,"data")
    local x,y,z = unpack(data)
    
    --2nd way >> data[i]
    setElementData(player,"data",{x,y,z})
    local data = getElementData(player,"data")
    local x,y,z = data[1],data[2],data[3]
    
    --3rd way >> fromJSON
    setElementData(player,"data",toJSON(x,y,z))
    local data = fromJSON(getElementData(player,"data"))
    --then i use the 3rd line of either of the last 2 ways

    Thanks in advance

  5. i got from debugscript 3 :-   

    dbPoll failed, near "WHERE":syntax error

    local grp_db = dbConnect("sqlite",":Chats/Groups/groups.db")
    dbQuery(getinfo,grp_db,"SELECT name FROM groups WHERE groupName = ? AND WHERE rank = ?","Sisqo","Owner")
    
    function getinfo(q)
    	if (q) then
    		local p = dbPoll(q,-1)
    		if (#p > 0) then
    			for _,d in pairs(p) do
                    outputChatBox(tostring(d["name"]))
    			end
    		end
    	end
    end

    if i removed the second "WHERE" and "AND" , it would work so the question is "How to put 'WHERE' twice?"

  6. there is nothing wrong here so those can be the reason :-

    3 hours ago, JeweL said:

    isObjectAroundPlayer2

    or 

    3 hours ago, JeweL said:

    isInBuilding

    or maybe this event in server side

    3 hours ago, JeweL said:

    "createZomieForPlayer"

     

  7. I'm trying to put vehicles (have ColSphere) in the same location with different dimensions and Interiors but I got a problem that I can hit all the colshapes with onClientColShapeHit although I'm in another dimension and interior. I tried to check the dimension with getElementDimension and parameter of onClientColShapeHit function ( matchingDimension ) but neither of them could help.

    Is there a way to solve that? Thanks in advance.

  8. you can try this 

    local swic = guiCreateStaticImage( 980, 190, 35, 35, "files/switch_button.png", false ) ----------------------------------Clicking the button
    
    function openpanel()----------------------------------------Opening the Next Panel by clicking the button
            dxDrawRectangle((screenW - 666) / 2, (screenH - 450) / 2, 666, 450, tocolor(0, 0, 0, 203), false)----------------------------------I want the panel to open
    end
    addEventHandler ( "onClientGUIClick", swic, openpanel, false )

     

  9. 5 hours ago, xLive said:

    btw @Sisqo0 you can use the global variables instead of these functions
    getRootElement()  - root
    getLocalPlayer() - localPlayer
    getResourceRootElement() resourceRoot

    Yes i know them. Anyways thanks ?

  10. no, it will remove event for the player who clicked only but if any player of that team pressed on button.. nothing would happen as someone before pressed on it. 

    Btw you don't need to remove it from all players if it doesn't affect what you want to do but if you still want to remove it, then i have no idea but even if there's a way, i don't think it can be done by client only ( maybe you need to use server side). good luck. 

    • Like 1
  11. here is a way. maybe it's not perfect but addEventHandler & removeEventHandler work for the client only so you need to find another way to reach your goal and here is one. 

    --client side
    local Button1 = guiCreateButton(--There are no valid arguments
    )
    
    addEventHandler("onClientGUIClick", Button1, OnTeamPlayerClickLVL)
    
    function OnTeamPlayerClickLVL()
      local team = getPlayerTeam(getLocalPlayer())
      local level = (getElementData(team,"level") or 0)
      	for i, v in pairs(getPlayersInTeam(team)) do
        if level == 0 then
        	outputChatBox("U bought level 1 for your TEAM ^^", 0, 255, 0)
            setElementData(team,"level",1)
        elseif level == 1 then
          outputChatBox("U bought level 2 for your Team ^^", 0,255,0) 
          setElementData(team,"level",2) 
          removeEventHandler("onClientGUIClick", Button1,OnTeamPlayerClickLVL) 
        end
        end
      end
    -- server side
    
    RED = createTeam("Red Team", 255, 0, 0)
    BLUE = createTeam("Blue Team", 0, 0, 255)

     

  12. it's client side so the function will work for the player who clicked only.. i don't even think that getElementsByType('player') would work but you can try. 

  13. -- in login panel resource
    
    -- put in meta.xml
    <download_priority_group>1</download_priority_group>
    -- client 
    function checkTransfer()
    	if isTransferBoxActive() then
    		setTimer(checkTransfer,2000,1)
    	else 
            triggerServerEvent("spawnplayer", resourceRoot,localPlayer,0,0,0) 
      end
    end
    addEventHandler("onClientResourceStart",resourceRoot,checkTransfer)
    
    --Server 
    function spawnplayer(player,x,y,z) 
      spawnPlayer(player,x,y,z) 
    end
    addEvent( "spawnplayer", true )
    addEventHandler( "spawnplayer", resourceRoot, spawnplayer )

    i think this can help you. 

  14. i see that you are trying to receive information from client by triggerClientEvent and you did it too in server. triggerServerEvent or triggerClientEvent are used to pass information or give an order not to receive. i will fix your code but you should learn from it not just copy and paste. 

    -- server side
    marker = createMarker(0, 0, 1.5, "cylinder", 2, 255, 0, 0)
    setElementData(marker, "Item", 5)
    
    addEvent("GetItem", true)
    addEventHandler("GetItem", root, function() 
          local ItemOfClientMarker = getElementData(marker, "Item")
          triggerClientEvent("DrawText", resourceRoot, marker, tostring(ItemOfClientMarker), 2, 50, 255, 255, 0, 3, "arial")-- i pass info from server to event 'DrawText' in client [ marker, tostring.., "arial") 
    end)
    
    addEventHandler("onMarkerHit", marker, function(hp)
    local ElementVariable = ( getElementData(hp, "ItemTwo") or 0) --getplayer 'itemtwo' or get "0" if he doesn't have "ItemTwo" data
    setElementData(hp, "ItemTwo", ElementVariable+getElementData(marker, "Item"))
    end)
    
    -- client side
    function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,...)
    local x, y, z = getElementPosition(TheElement)
    local x2, y2, z2 = getCameraMatrix()
    local distance = distance or 20
    local height = height or 1
    
    if (isLineOfSightClear(x, y, z+2, x2, y2, z2, ...)) then
    local sx, sy = getScreenFromWorldPosition(x, y, z+height)
    if(sx) and (sy) then
    local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
    if(distanceBetweenPoints < distance) then
    dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center")
    end
    end
    end
    end
    addEvent("DrawText", true)
    addEventHandler("DrawText", root, dxDrawTextOnElement) 
    
    
    addEventHandler("onClientRender", root, function()
    triggerServerEvent("GetItem", root)--give an order to make this event "getItem" run in server per frame
    end)

     

    • Thanks 1
  15. -- those functions are shared so you can set and get data from server or client to other 
    setElementData 
    getElementData 
    
    -- about trigger server from client and client from server 
    -- i see that the example in wiki is very easy and enough to teach anyone 
    triggerServerEvent 
    triggerClientEvent 

     

  16. بصوره ? و لما اللاعب يضغط عليه تحفظ الداتا بانه عمل ليك زي كدا مثلا button تقدر مثلا تعمل زرار 

    ads = {
      ad1 = {},
      ad2 = {}
      }
    
    --لما لاعب يضغط لايك علي الاعلان الاول تعمل كدا
    table.insert(ads.ad1, player)
    --وعلشان تعرف كل الناس اللي عملت لايك علي اعلان رقم واحد
    for i,v in ipairs(ads.ad1) do
       outputChatBox(i.."- "..v) 
    end

      ايضا database ده مثال بسيط ليك و تقدر تعمل احسن منه طبعا و ممكن تستخدم فيه 

  17. Quote

    source -- The player or element the event was attached to

    That's why you don't get the player since you're using timer.

    Your code has some mistakes too such as you are trying to trigger client side from server by triggerServerEvent and the right is triggerClientEvent. 

    infinity timer can cause some problems as well especially you made it every 3 sec. You can use this better

    "onElementDataChange"

    and about the element in marker, you can do this

    function elementinmarker(element) 
      setTimer(function()
          if element then
            if isElementWithinMarker(element,cylinder) then
            -- Your code
            end
          end
         end,3000, 1)
    end
    addEventHandler("onMarkerHit",cylinder,elementinmarker) 

    and it would be better if you make the whole code server side

    • Like 1
  18. Did you define the sound in meta.xml ? & how many numbers of the sounds did you define? 

    It would be better if you did /debugscript 3 ingame and show us 

×
×
  • Create New...