ed
This commit is contained in:
		
							parent
							
								
									453b25b260
								
							
						
					
					
						commit
						59951edece
					
				
					 9 changed files with 901 additions and 1 deletions
				
			
		
							
								
								
									
										20
									
								
								resources/[carscripts]/sg-boatanchor/server/server.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								resources/[carscripts]/sg-boatanchor/server/server.lua
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| local QBCore = exports['qb-core']:GetCoreObject() | ||||
| local anchoredBoats = {} | ||||
|  | ||||
| QBCore.Functions.CreateCallback('sg-boatanchor:server:isBoatAnchored', function(source, cb, boatNetId) | ||||
|   if anchoredBoats[boatNetId] then | ||||
|     cb(anchoredBoats[boatNetId].anchored) | ||||
|   else | ||||
|     cb(false) | ||||
|   end | ||||
| end) | ||||
|  | ||||
| RegisterNetEvent('sg-boatanchor:server:setAnchor', function(boatNetId, isAnchored) | ||||
|   local Player = QBCore.Functions.GetPlayer(source) | ||||
|   if Player and boatNetId then | ||||
|     anchoredBoats[boatNetId] = { | ||||
|       anchored = isAnchored   | ||||
|     } | ||||
|     TriggerClientEvent('sg-boatanchor:client:setAnchoredBoats', -1, anchoredBoats) | ||||
|   end | ||||
| end) | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nordi98
						Nordi98