Jump to content

icarus

Members
  • Posts

    33
  • Joined

  • Last visited

Posts posted by icarus

  1. So this is a problem i've been having a lot , and not just at a specific server, but all. 
    What happens is, im in a server playing normaly, then i get " Network trouble" then i get kicked out because of that. After that, i get a good time without being able to connect to any server, always get "timed out".
    Now this is a thing that happens a lot to me, at any server, and then i check my internet conection and there are no problems whatsoever, so that wouldnt be the problem either, also the computer is pretty good.

    I used MTADiag, is it safe to share it here?

    Edit: there was a mistake and i thought i did post this but i didnt, so if the MTADiag log is requiered ill have to do it again.

  2. yeah lol, this must be simplier, but still cant work with it

    ---clientside 
    function tazerreload( startedRes ) 
    setWeaponProperty ( 23, "maximum_clip_ammo", 1 ) 
    end 
    addEventHandler( "onClientResourceStart", getLocalPlayer( ),tazerreload) 
    

  3. I made this but for idk why it doesnt work, it doesnt even output a debugscript message, can u help ?

    ---Clientside 
    function reloadtazerclient () 
    if getPedWeapon ( getLocalPlayer())== 23 then 
    triggerServerEvent ("ontazershoot", getLocalPlayer()) 
    end 
    end 
    addEventHandler ("onClientPedWeaponFire", getRootElement(), reloadtazerclient) 
      
    

    ---Serverside 
    addEvent ("ontazershoot", true) 
      
    function tazershootserverside(sourcePlayer) 
    reloadPedWeapon ( sourcePlayer ) 
    end 
    addEventHandler("ontazershoot", getRootElement(),tazershootserverside) 
    

    (i already tryed "(source)" insted of "(sourcePlayer)", and "weapon == 23" insted of " getPedWeapon ( getLocalPlayer())== 23", and didnt work.

  4. I made this part, i already tryed "if", nbut didnt work, so i tryed "if not", still the same.

    this is part of the script

      
    ---serverside 
    function checkBBHQspawn() 
      if not isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( source ) ), aclGetGroup( "Admin" ) ) then 
      triggerClientEvent ("onnotHQverification", source)  
    else 
        setPlayerNametagColor ( source, 255, 140, 0 ) 
        spawnPlayer ( source, 2392, 2792, 14, 180, 211, 0, 0, blackbulletsteam ) 
        giveWeapon ( source, 31, 500) 
        giveWeapon ( source, 27, 500) 
        giveWeapon ( source, 24, 150) 
        giveWeapon ( source, 34, 150) 
        giveWeapon ( source, 46, 150) 
        giveWeapon ( source, 16, 30)    
    end 
    end 
    addEventHandler("onHQbbmembersbutton", getRootElement(),checkBBHQspawn) 
    

    ---Clientside 
      
    addEvent ("onnotHQverification", true) 
      
    function ifnotBBHQ() 
    outputChatBox ( "#FF0000You need to be HQ or Admin to spawn as HQ", 255, 255, 255, true ) 
    end 
    addEventHandler("onnotHQverification",getLocalPlayer(),ifnotBBHQ) 
    

    I dont know whats the problem, it outputs the chatbox, but it still it lets the player spawn, can u help me on this ?

  5. thanks, it works , i have other question, if i wanted to match a random place how could i do it.

    Like in this

    function (attacker, gun) 
      if getTeamName(getPlayerTeam(attacker)) == "Police" then -- if attacker was a cop 
       if gun == 23 or gun == 3 then -- if it was a tazer or stick 
        setElementPosition(source, -643.82635498047, 1945.7033691406, 2) 
        setElementPosition(source, -1980, 4991, 39)-- set there position 
       end 
    end 
    end 
    ) 
      
      
    

    i wanted to make it to warp it or to a place or to the other

  6. i was trying to make that when a player that is inside a colshape after a timer get warped to a place.

    I dont know whats wrong with this.

    function warpplayer ( thePlayer ) 
            if isElementWithinColShape ( thePlayer, Bankcol ) then 
        setElementPosition ( thePlayer, 2655, 2706, 411 ) 
    end 
    end 
    

    Also tryed this, actually i tyed this first

    function warpplayer ( source ) 
            if isElementWithinColShape ( source, Bankcol ) then 
        setElementPosition ( source, 2655, 2706, 411 ) 
    end 
    

    The debugscript 3 message is always the same: Bad argument @ "isElementWithinColShape" [Expected element at argument 1]

    Can someone help me at this ?

  7. Sorry to bother again.

    What i wanna do is make is add a new gui that is almost equal to the other , but the difference is that i want to change they keypad window name to other that opens when i hit another marker, and updates other trigger vent, and the code is different.

    I tried doing it , but the results are almost everytime the same, like the display of the first gui shows in the second, the code is the same at the 2 guis. The Guis confuse themselves.

    can you help me, what do i need to add to the version i uploaded here client/server side , in order to make it work and simple.

  8. So what i wanna make is, create a marker at serverside, and when a player hits that marker it shows a gui that is at clientside.

    I made this but doesnt work, can someone help me.

    -----Serverside 
    local door1marker = createMarker ( 2655, 2706, 411, "arrow", 1, 100, 20, 20 ) 
      
    function door1markerhit( hitElement, matchingDimension )  
        if  getElementType( hitElement ) == Player then 
         triggerClientEvent ( Player, "ondoor1markerhit", Player ) 
    end 
    end 
    addEventHandler( "onMarkerHit", door1marker, door1markerhit ) 
    

    ----Clientside 
    addEvent ( "ondoor1markerhit", true ) 
    function showguidoor1 () 
        guiSetVisible(keypadWindow,true) 
        showCursor(true,true) 
        setElementData(keypadWindow,"keypadID","GateKeypadCode") 
    end 
    addEventHandler( "ondoor1markerhit", getLocalPlayer ( ), showguidoor1 ) 
    

  9. kk, client side is this, the problem is probably there, im new at scripting,so thats probably it.

    local bankrob = createMarker ( 2655, 2706, 411, "arrow", 1, 100, 20, 20 ) 
    function createKeypad() 
      
        local sWidth, sHeight = guiGetScreenSize() 
      
      
        local Width,Height = 142,276 
        local X = (sWidth/2) - (Width/2) 
        local Y = (sHeight/2) - (Height/2) 
        keypadWindow = guiCreateWindow(X,Y,Width,Height,"Keypad",false) 
      
        addEventHandler("onClientGUIClick",keypadWindow,processKeypadClicks,true) 
      
      
        guiWindowSetSizable(keypadWindow,false) 
      
      
        keypadButton1 = guiCreateButton(13,68,37,36,"1",false,keypadWindow) 
        keypadButton2 = guiCreateButton(53,68,37,36,"2",false,keypadWindow) 
        keypadButton3 = guiCreateButton(93,68,37,36,"3",false,keypadWindow) 
        keypadButton4 = guiCreateButton(13,108,37,36,"4",false,keypadWindow) 
        keypadButton5 = guiCreateButton(53,108,37,36,"5",false,keypadWindow) 
        keypadButton6 = guiCreateButton(93,108,37,36,"6",false,keypadWindow) 
        keypadButton7 = guiCreateButton(13,148,37,36,"7",false,keypadWindow) 
        keypadButton8 = guiCreateButton(53,148,37,36,"8",false,keypadWindow) 
        keypadButton9 = guiCreateButton(93,148,37,36,"9",false,keypadWindow) 
        keypadButtonAsterix = guiCreateButton(13,188,37,36,"*",false,keypadWindow) 
        keypadButton0 = guiCreateButton(53,188,37,36,"0",false,keypadWindow) 
        keypadButtonHash = guiCreateButton(93,188,37,36,"#",false,keypadWindow) 
        keypadButtonExit = guiCreateButton(13,228,37,36,"Exit",false,keypadWindow) 
        keypadButtonEnter = guiCreateButton(53,228,37,36,"Enter",false,keypadWindow) 
        keypadButtonClear = guiCreateButton(93,228,37,36,"Clear",false,keypadWindow) 
      
      
        keypadGridlistDisplay = guiCreateGridList(13,25,117,33,false,keypadWindow) 
        guiGridListSetSelectionMode(keypadGridlistDisplay,2) 
        guiSetAlpha(keypadGridlistDisplay,0.6) 
      
        keypadLabelDisplay = guiCreateLabel(14,26,115,30,"Enter Keycode.",false,keypadWindow) 
        guiLabelSetColor(keypadLabelDisplay,255,000,000) 
        guiLabelSetVerticalAlign(keypadLabelDisplay,"center") 
        guiLabelSetHorizontalAlign(keypadLabelDisplay,"center",false) 
      
        guiSetVisible(keypadWindow,false) 
    end 
      
      
    addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),createKeypad) 
      
    function updateDisplay(text) 
      
        if text then 
      
            if tonumber(text) or text == "*" or text == "#" then 
                guiSetText(keypadLabelDisplay,guiGetText(keypadLabelDisplay) .. text) 
      
            else 
                guiSetText(keypadLabelDisplay,text) 
            end  
      
        else 
            guiSetText(keypadLabelDisplay,"") 
        end 
    end 
      
    function processKeypadClicks(button,state) 
        if button == "left" and state == "up" then 
      
            if getElementType(source) == "gui-button" then 
      
                triggerEvent("onKeypadButtonClicked",source,getElementData(keypadWindow,"keypadID")) 
            end 
        end 
    end 
      
    addEvent("onKeypadButtonClicked",false) 
    addEventHandler("onKeypadButtonClicked",root, 
        function(keypadID) 
      
            if guiGetText(keypadLabelDisplay) == "Enter Keycode." or guiGetText(keypadLabelDisplay) == "Lower" or guiGetText(keypadLabelDisplay) == "Higher" then 
                updateDisplay() 
            end 
      
      
      
            if guiGetText(source) == "Clear" then 
      
                updateDisplay() 
      
      
            elseif guiGetText(source) == "Enter" then 
      
                local code = guiGetText(keypadLabelDisplay) 
      
      
                if code then 
      
                    triggerServerEvent("verifyKeypadCode",getLocalPlayer(),code,keypadID) 
                end 
      
      
            elseif guiGetText(source) == "Exit" then 
      
                guiSetVisible(keypadWindow,false) 
                updateDisplay("Enter Keycode.") 
                showCursor(false,false) 
      
      
            else 
                updateDisplay(guiGetText(source))    
            end 
        end 
    ) 
      
    addEvent("onKeypadVerificationSuccessful",true) 
    addEventHandler("onKeypadVerificationSuccessful",root, 
        function() 
      
            guiSetVisible(keypadWindow,false) 
            updateDisplay("Enter Keycode.") 
            showCursor(false,false) 
        end 
    ) 
      
    addEvent("oncodeishigher",true) 
    addEventHandler("oncodeishigher",root, 
        function() 
      
            updateDisplay("Higher") 
        end 
    ) 
      
    addEvent("oncodeislower",true) 
    addEventHandler("oncodeislower",root, 
        function() 
      
            updateDisplay("Lower") 
        end 
    ) 
      
    

  10. you mean, like this ?

      
    local keypadCodes = { 
        ["a51MainGateKeypadCode"] = math.random (0, 50000) 
    } 
    addEvent("verifyKeypadCode",true) 
    addEventHandler("verifyKeypadCode",root,function(code,keypadID) 
        if code then 
      
            if code == tonumber(code) then 
      
                triggerClientEvent(client,"onKeypadVerificationSuccessful",client,keypadID) 
            elseif code >= tonumber(code) then  
      
                triggerClientEvent(client,"oncodeishigher",client,keypadID) 
                    elseif code <= tonumber(code) then  
                             
                            triggerClientEvent(client,"oncodeislower",client,keypadID) 
            end 
        end 
    end) 
    

×
×
  • Create New...