Jump to content

AJXB

Members
  • Posts

    367
  • Joined

  • Last visited

Posts posted by AJXB

  1. 2 hours ago, Sorata_Kanda said:

    I do use the db functions too, but I'm sort of worried that my meta.xml turns to a mess due to the amount of functions I export.

    The healthy thing to do is to make one resource and just export the functions.

    Otherwise, you're just repeating code and that's useless.

  2. On 02/09/2018 at 05:25, Simple01 said:
    // SERVER
    
    function nickHandler( playerNick )
    	if ( playerNick and ( #playerNick <= 3 ) ) then
        	// DO SOMETHING
         	cancelEvent() // KICK
        end
    end
    
    addEventHandler( 'onPlayerConnect', root, nickHandler )
    

     

    Way to reinvent how Lua comments are supposed to be.

    • Haha 1
  3. On 7/15/2018 at 12:57, Lampard1 said:

    Thank you for your feedback. All the resources we are providing on our shop will get updated, with new versions being released regularly. In one of the version, we will surely change our GUIs! :)

    And if I may ask, do you update the purchased resources for each client after you update the versions?

    Also, how are you protecting these resources from being leaked? (someone can purchase one resource and leak it since you're selling the source code, I presume)

  4. 16 hours ago, iSubvibe said:

    you both don't know what you're talking about.  show me how u can make a theme?'

     

    themes aren't useless. i've sold themes for 200 euros you just dont know the work people put in IPS themes.

    They aren't useless, they look good, and your theme looks good. but if you think it's worth 200 euros, it's not. at least not to me. But I wouldn't be surprised if "clans" pay that much.

    Anyway, good luck

  5.     local serialMute = { }
    
        	function doAction(thePlayer, cmd, actionId, playername, arg3)
            if (isElement( thePlayer )) then
        		if actionId then
        			local actionId = tonumber(actionId) 
        			local player = getPlayerFromNamePart(playername or "")
        			local name = getPlayerName(thePlayer)
        			if player then
        				if actionId == 1 then
    						local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
             				if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
    	    					local duration = (tonumber(arg3) or 0) * 60 * 1000
    	    					setPlayerMuted(player, true)
    	    					outputChatBox(getPlayerName(player).." #005A0Ehas been muted by #FFFFFF"..name.."#005A0E.#FFFFFF Reason: insulting #005A0EDuration #FFFFFF["..math.floor((duration *1.66666667 * 1/100000)).." mins].", root, 255, 255, 255, true)
    	    					local timer = setTimer ( unmute, duration, 1, player )
    	    					serialMute [ getPlayerSerial ( player ) ] = { duration, timer })
        					end
        				end
        			else
        				outputChatBox("Could not find the player.",thePlayer, 255, 0, 0)
        			end
        		end
        	end
        end
        addCommandHandler("action", doAction)
    
        function unmutePlayer(player,command,victimName)
        	if victimName then
        		local victim = getPlayerFromNamePart(victimName or "")
        		if victim then
        			if ( isPlayerMuted(victim) ) then
        				setPlayerMuted(victim, false)
        			end
        		end
        	end
        end
        addCommandHandler("unmute",unmutePlayer)
    
        function onJoin ()
            local serial = getPlayerSerial(source)
            local muted = serialMute [ serial ]
            if ( type ( muted ) == "table" ) then
                if ( muted [ 1 ] ) then
                    setPlayerMuted ( source, true )
                    local timer = setTimer ( unmute, muted [ 1 ], 1, source )
                    serialMute [ serial ] [ 2 ] = timer
         
                    return
                end
            end
            setPlayerMuted ( source, false )
        end
        addEventHandler ( "onPlayerJoin", getRootElement(), onJoin )
         
        addEventHandler ( "onPlayerQuit", root,
            function ( )
                local serial = getPlayerSerial ( source )
                local muted = serialMute [ serial ]
                if ( type ( muted ) == "table" ) then
                    if isTimer ( muted [ 2 ] ) then
                        local timeLeft = getTimerDetails ( muted [ 2 ] )
                        killTimer ( muted [ 2 ] )
                        serialMute [ serial ] [ 1 ] = timeLeft
                    end
                end
            end
        )
         
        function unmute ( thePlayer )
            if isElement ( thePlayer ) then
                setPlayerMuted ( thePlayer, false )
                serialMute [ getPlayerSerial ( thePlayer ) ] = nil
                outputChatBox ( "You have been unmuted by Console.", thePlayer, 0, 255, 100 )
            end
        end
    
        function getPlayerFromNamePart(name)
            if name then
                for i, player in ipairs(getElementsByType("player")) do
                    if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then
                        return player
                    end
                end
            end
            return false
        end

    Try this

  6. That function clearly triggers

    addEventHandler("onPedWasted", resourceRoot, deanimated)

    onPedWasted, the Wasted part means the ped is dead, thus, it triggers when the Zombie is dead.

    You should make a different event/function onPedDamage

×
×
  • Create New...