Wysłany: 2020-12-13, 17:07
NoNamik
Wiek: 35 Na forum: 2185 dni Posty: 289
Nick w MP: JestemNoNamem
Piwa : 374
Witam posiadam skrypt na nozyco rozpieracz lecz chcia?bym zeby on dzia?a? na paczce od pysa co trzeba w nim zmienic?
addEvent ( "ev" , true )
addEventHandler ( "ev" , resourceRoot ,
function( ev , arg1 , arg2 )
if ( ev == "wylam_drzwi" ) then
local veh = arg1
local drzwi = arg2
local x , y , z = getElementPosition ( client )
if ( getVehicleDoorState ( veh , drzwi )== 4 ) then
return
end
triggerClientEvent ( root , "evc" , resourceRoot , "wlacz_dzwiek" , x , y , z )
setPedAnimation ( client , "CHAINSAW" , "csaw_part" ,- 1 , true , false , false )
setTimer (function()
if veh and isElement ( veh ) and drzwi then
setVehicleDoorState ( veh , drzwi , 2 )
end
end , 2500 , 1 )
setTimer (function( client )
if client and isElement ( client ) and veh and isElement ( veh ) and drzwi then
setPedAnimation ( client )
setVehicleDoorState ( veh , drzwi , 4 )
local vehid = getElementData ( veh , "dbid" )
if not vehid then
vehid = "pojazd nie jest prywatny - nie posiada ID"
end
exports [ "es-logi" ]: outputUcho ( "ROZPIERACZ PSP: " .. getPlayerName ( client ).. " DBID: " .. getElementData ( client , "dbid" ).. " u?ywa rozpieracza na poje?dzie o ID: " .. vehid .. "." )
end
end , 5000 , 1 , client )
end
end
)
Wysłany: 2020-12-13, 18:25
_jvneczek
Wiek: 22 Na forum: 4325 dni Posty: 1513
Nick w MP: _jvneczek
Piwa : 3949
elementdata dbid, zapewne export es-logi bo w pysie nie ma takiego skryptu, no i to tyle
Wysłany: 2020-12-14, 00:19
NoNamik
Wiek: 35 Na forum: 2185 dni Posty: 289
Nick w MP: JestemNoNamem
Piwa : 374
ok ale na co zmieni? te dbid bo odpowiada za id auta
Wysłany: 2020-12-14, 00:22
Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
na vehicle:id chyba ?e zmienia?e? przejrzyj sobie skrypt na pojazdy
Wysłany: 2020-12-14, 16:33
NoNamik
Wiek: 35 Na forum: 2185 dni Posty: 289
Nick w MP: JestemNoNamem
Piwa : 374
jeszcze client
function getPositionFromElementOffset ( element , offX , offY , offZ )
local m = getElementMatrix ( element ) -- Get the matrix
local x = offX * m [ 1 ][ 1 ] + offY * m [ 2 ][ 1 ] + offZ * m [ 3 ][ 1 ] + m [ 4 ][ 1 ] -- Apply transform
local y = offX * m [ 1 ][ 2 ] + offY * m [ 2 ][ 2 ] + offZ * m [ 3 ][ 2 ] + m [ 4 ][ 2 ]
local z = offX * m [ 1 ][ 3 ] + offY * m [ 2 ][ 3 ] + offZ * m [ 3 ][ 3 ] + m [ 4 ][ 3 ]
return x , y , z -- Return the transformed point
end
local isStrazak =(
function( plr )
if (( getElementData ( plr , "PSP:ranga" ) and getElementData ( plr , "PSP:sluzba" )) or ( getElementData ( plr , "OSP:ranga" ) and getElementData ( plr , "OSP:sluzba" ))) then
return true
end
return false
end
)
--[[
addEventHandler ( "onClientRender" , root ,
function()
local x , y , z = getElementPosition ( localPlayer )
local offx , offy , offz = getPositionFromElementOffset ( localPlayer , 0 , 1.1 , 0 )
dxDrawLine3D ( x , y , z , offx , offy , offz )
end
)]]--
bindKey ( "h" , "down" ,
function()
if not isStrazak ( localPlayer ) then
return
end
if ( getPedWeapon ( localPlayer )~= 37 ) then
return
end
local x , y , z = getElementPosition ( localPlayer )
local offx , offy , offz = getPositionFromElementOffset ( localPlayer , 0 , 1.1 , 0 )
if isLineOfSightClear ( x , y , z , offx , offy , offz , false , true , false , false , false ) then
-- exports [ "es-komunikaty" ]: komunikat ( "Sta? twarz? do pojazdu lub podejd? bli?ej." )
return
end
local hit , _ , _ , _ , veh , _ , _ , _ , _ , _ , piece = processLineOfSight ( x , y , z , offx , offy , offz , false , true , false , false , false )
if not hit then
return
end
if ( getElementType ( veh )~= "vehicle" ) then
return
end
if veh and isElement ( veh ) then
if not piece then
return
end
if ( piece == 5 ) then
piece = 2
elseif ( piece == 6 ) then
piece = 3
elseif ( piece == 7 ) then
piece = 4
elseif ( piece == 8 ) then
piece = 5
else
exports [ "es-komunikaty" ]: komunikat ( "Musisz sta? przodem do wybranych drzwi." )
return
end
triggerServerEvent ( "ev" , resourceRoot , "wylam_drzwi" , veh , piece )
end
end
)
addEvent ( "evc" , true )
addEventHandler ( "evc" , resourceRoot ,
function( ev , arg1 , arg2 , arg3 )
if ( ev == "wlacz_dzwiek" ) then
local x , y , z = arg1 , arg2 , arg3
local s = playSound3D ( "rozpierak.mp3" , x , y , z , false )
setSoundVolume ( s , 25 )
setSoundMaxDistance ( s , 20 )
end
end
)
-- piece :
-- 5 : Front left door
-- 6 : Front right door
-- 7 : Rear left door
-- 8 : Rear right door
-- doorstate :
-- 2 : Front left
-- 3 : Front right
-- 4 : Rear left
-- 5 : Rear right
--[[
bool -- hit
float float float -- hitX , hitY , hitZ
element -- hitElement
float float float -- normalX , normalY , normalZ
int -- material
float -- lighting
int -- piece
int -- worldModelID
float float float -- worldModelPositionX , Y , Z
float float float -- worldModelRotationX , Y , Z
int -- worldLODModelID
processLineOfSight ( float startX , float startY , float startZ ,
float endX , float endY , float endZ ,
[ bool checkBuildings = true ,
bool checkVehicles = true ,
bool checkPlayers = true ,
bool checkObjects = true ,
bool checkDummies = true ,
bool seeThroughStuff = false ,
bool ignoreSomeObjectsForCamera = false ,
bool shootThroughStuff = false ,
element ignoredElement = nil ,
bool includeWorldModelInformation = false ,
bool bIncludeCarTyres ] )
]]--
Wysłany: 2020-12-14, 16:37
_jvneczek
Wiek: 22 Na forum: 4325 dni Posty: 1513
Nick w MP: _jvneczek
Piwa : 3949
Tylko
if (( getElementData ( plr , "PSP:ranga" ) and getElementData ( plr , "PSP:sluzba" )) or ( getElementData ( plr , "OSP:ranga" ) and getElementData ( plr , "OSP:sluzba" ))) then
na przyk?ad na elementdate player:faction == "SAFD"
if getElementData ( plr , "player:faction" ) == "SAFD" then
Tagi: nozyco :: rozpieracz
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: