propfix
This commit is contained in:
		
							parent
							
								
									1fe44ee3bb
								
							
						
					
					
						commit
						2396aec905
					
				
					 6 changed files with 9 additions and 9 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								resources/[tools]/PS_PropFix/.fxap
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/[tools]/PS_PropFix/.fxap
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										23
									
								
								resources/[tools]/PS_PropFix/README.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								resources/[tools]/PS_PropFix/README.md
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,23 @@
 | 
			
		|||
## Support 
 | 
			
		||||
 | 
			
		||||
Join our Discord for support and feature scripts: https://discord.gg/XQHVstYRGx
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## What does it do exactly?
 | 
			
		||||
Have you ever experienced the frustration of performing an emote and having a prop get stuck in your hand? With this script,
 | 
			
		||||
you can simply use the /propfix command to remove the prop. No need to reconnect every time. 
 | 
			
		||||
Enjoy the seamless experience!
 | 
			
		||||
 | 
			
		||||
## Installation instructions
 | 
			
		||||
 | 
			
		||||
1. Download the script.
 | 
			
		||||
2. Place it in your resources folder.
 | 
			
		||||
3. Edit the configuration file to customize your command.
 | 
			
		||||
4. Add the following line to your server.cfg: ensure PS_PropFix.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
If you have any additional details or specific configuration options you'd like to include, feel free to let me know!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
PlexScripts
 | 
			
		||||
							
								
								
									
										100
									
								
								resources/[tools]/PS_PropFix/client/client.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								resources/[tools]/PS_PropFix/client/client.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,100 @@
 | 
			
		|||
 | 
			
		||||
if Config.Framework == "ESX" then
 | 
			
		||||
    ESX = exports['es_extended']:getSharedObject()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Add a wait loop to ensure ESX is loaded
 | 
			
		||||
if Config.Framework == "ESX" then
 | 
			
		||||
    while not ESX do
 | 
			
		||||
        Citizen.Wait(100)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
if Config.Framework == "qb-core" then
 | 
			
		||||
    QBCore = exports['qb-core']:GetCoreObject()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
RegisterCommand(Config.PropFixCommand, function(source, args, rawCommand)
 | 
			
		||||
    local xPlayer = PlayerPedId()
 | 
			
		||||
    
 | 
			
		||||
   
 | 
			
		||||
    function RemoveAttachedObjects(ped)
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
        local handle, object = FindFirstObject()
 | 
			
		||||
        local finished = false
 | 
			
		||||
        local count = 0
 | 
			
		||||
 | 
			
		||||
        repeat
 | 
			
		||||
            if DoesEntityExist(object) then
 | 
			
		||||
                if IsEntityAttachedToEntity(object, ped) then
 | 
			
		||||
                    DetachEntity(object, true, true) 
 | 
			
		||||
                    SetEntityAsMissionEntity(object, true, true) 
 | 
			
		||||
                    DeleteObject(object) 
 | 
			
		||||
                    Wait(0) 
 | 
			
		||||
                    if not DoesEntityExist(object) then
 | 
			
		||||
                        count = count + 1
 | 
			
		||||
                       
 | 
			
		||||
                    else
 | 
			
		||||
                       
 | 
			
		||||
                    end
 | 
			
		||||
                end
 | 
			
		||||
            end
 | 
			
		||||
            finished, object = FindNextObject(handle)
 | 
			
		||||
        until not finished
 | 
			
		||||
 | 
			
		||||
        EndFindObject(handle)
 | 
			
		||||
        
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    RemoveAttachedObjects(xPlayer)
 | 
			
		||||
 | 
			
		||||
    if Config.SendNotification then 
 | 
			
		||||
        local msg = Config.NotificationMsg
 | 
			
		||||
        local type = "success"
 | 
			
		||||
 | 
			
		||||
        Notify(msg, type)
 | 
			
		||||
    end
 | 
			
		||||
    if Config.ResetTasks then
 | 
			
		||||
        ClearPedTasks(xPlayer)
 | 
			
		||||
    end
 | 
			
		||||
end, false)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function Notify(msg, type)
 | 
			
		||||
    if Config.Notify == "ESX" then
 | 
			
		||||
        if type == "info" then 
 | 
			
		||||
            ESX.ShowNotification(msg, type, 5000)   
 | 
			
		||||
        end
 | 
			
		||||
        if type == "success" then
 | 
			
		||||
            ESX.ShowNotification(msg, type, 5000)   
 | 
			
		||||
        end
 | 
			
		||||
        if type == "error" then
 | 
			
		||||
            ESX.ShowNotification(msg, type, 5000)
 | 
			
		||||
        end
 | 
			
		||||
    elseif Config.Notify == "qb-core" then
 | 
			
		||||
        if type == "primary" then 
 | 
			
		||||
            QBCore.Functions.Notify(msg, "primary", 5000)
 | 
			
		||||
        end
 | 
			
		||||
        if type == "success" then
 | 
			
		||||
            QBCore.Functions.Notify(msg, "success", 5000)
 | 
			
		||||
        end
 | 
			
		||||
        if type == "error" then
 | 
			
		||||
            QBCore.Functions.Notify(msg, "error", 5000)
 | 
			
		||||
        end
 | 
			
		||||
    elseif Config.Notify == "standalone" then
 | 
			
		||||
        ShowNotification(msg)
 | 
			
		||||
    elseif Config.Notify == "custom" then
 | 
			
		||||
        --add here your notify trigger
 | 
			
		||||
    else
 | 
			
		||||
        print("Unknown framework specified in Config.Framework!")
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ShowNotification(msg)
 | 
			
		||||
    SetNotificationTextEntry("STRING")
 | 
			
		||||
    AddTextComponentString(msg)
 | 
			
		||||
    DrawNotification(false, true)
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										9
									
								
								resources/[tools]/PS_PropFix/config.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								resources/[tools]/PS_PropFix/config.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
Config = {}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Config.Framework = "qb-core" -- ESX / qb-core / standalone
 | 
			
		||||
Config.PropFixCommand = "propfix" --Add here your command to delet the props.
 | 
			
		||||
Config.ResetTasks = true  --If this is true, all animations will be canceled to.
 | 
			
		||||
Config.SendNotification = true --If you want that the player get a notification then put this to ture
 | 
			
		||||
Config.NotificationMsg = "Alle verbuggeden Props wurde gelöscht!" -- Add here your notification text that should displayed for your players
 | 
			
		||||
Config.Notify = "qb-core" --Change here you notifysystem qb-core / ESX / standalone / custom (for custom you need to add the trigger in the client.lua line 73)
 | 
			
		||||
							
								
								
									
										32
									
								
								resources/[tools]/PS_PropFix/fxmanifest.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								resources/[tools]/PS_PropFix/fxmanifest.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
fx_version 'cerulean'
 | 
			
		||||
game 'gta5'
 | 
			
		||||
 | 
			
		||||
author 'PlexScripts'
 | 
			
		||||
description 'PS_PropFix'
 | 
			
		||||
version '1.0.0'
 | 
			
		||||
 | 
			
		||||
lua54 'yes'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
escrow_ignore {
 | 
			
		||||
'config.lua',
 | 
			
		||||
'client/client.lua',
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
client_scripts {
 | 
			
		||||
'config.lua',
 | 
			
		||||
'client/client.lua',
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
escrow_ignore {
 | 
			
		||||
    'config.lua',
 | 
			
		||||
    'client/client.lua',
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dependency '/assetpacks'
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue