Wysłany: 2017-10-08, 13:10
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
witam, mam problem z kolczatk?, w takim sensie ?e jestem zalogowany na frakcj? sapd ale nie mog? stawia? kolczatki.
local kolczatki = {}
local cuboidy = {}
local pojazdy = {[ 598 ]= true ,[ 411 ]= true ,[ 597 ]= true ,[ 451 ]= true , [ 560 ]= true ,}
local odporny = {}
addEventHandler ( "onPlayerLogin" , root ,function( prevAcc , currAcc , auto )
local accName = getAccountName ( currAcc )
if getElementData ( source , 'player:duty' ) and getElementData ( source , 'player:duty' )== 'SAPD' then
bindKey ( getAccountPlayer ( currAcc ), "x" , "down" , postawkolczatke )
bindKey ( getAccountPlayer ( currAcc ), "c" , "down" , usunkolczatke )
end
end )
function postawkolczatke ( plr , key , keyState )
local veh = getPedOccupiedVehicle ( plr )
if pojazdy [ getElementModel ( veh )] then
setElementData ( plr , "odporny" , true )
triggerClientEvent ( plr , "znajdzmiejsce" , plr )
if odporny [ plr ] then
killTimer ( odporny [ plr ])
end
odporny [ plr ] = setTimer (function()
setElementData ( plr , "odporny" , false )
odporny [ plr ] = nil
end , 1000 , 1 )
end
end
addEvent ( "postaw" , true )
addEventHandler ( "postaw" , root ,function( x , y , z , rx , ry , rz )
if kolczatki [ source ] then
destroyElement ( kolczatki [ source ])
kolczatki [ source ] = nil
destroyElement ( cuboidy [ source ])
cuboidy [ source ] = nil
end
local kolczatka = createObject ( 2899 , x , y , z - 0.3 , rx , ry , rz + 90 ) -- 2899 , 2892
local cuboid = createColSphere ( x , y , z - 0.3 , 2.5 )
cuboidy [ source ] = cuboid
kolczatki [ source ] = kolczatka
end )
function usunkolczatke ( plr , key , keyState )
if source then
plr = source
end
if kolczatki [ plr ] then
destroyElement ( kolczatki [ plr ])
kolczatki [ plr ] = nil
destroyElement ( cuboidy [ plr ])
cuboidy [ plr ] = nil
if odporny [ plr ] then
killTimer ( odporny [ plr ])
odporny [ plr ] = nil
end
end
end
addEventHandler ( "onPlayerQuit" , root , usunkolczatke )
addEventHandler ( "onColShapeHit" , resourceRoot ,function( el , md )
if getElementType ( el ) ~= "player" or not md then return end
if getElementData ( el , "odporny" ) then return end
local veh = getPedOccupiedVehicle ( el )
if veh then
local x , y , z = getElementPosition ( source )
triggerClientEvent ( el , "sprawdzajopony" , el , x , y )
end
end )
addEventHandler ( "onColShapeLeave" , resourceRoot ,function( el , md )
if getElementType ( el ) ~= "player" or not md then return end
if getElementData ( el , "odporny" ) then return end
local veh = getPedOccupiedVehicle ( el )
if veh then
triggerClientEvent ( el , "przestansprawdzacopony" , el )
end
end )
addEvent ( "przebijopone" , true )
addEventHandler ( "przebijopone" , root ,function( opona )
local veh = getPedOccupiedVehicle ( source )
if opona == 1 then
setVehicleWheelStates ( veh , 1 )
elseif opona == 2 then
setVehicleWheelStates ( veh ,- 1 , 1 )
elseif opona == 3 then
setVehicleWheelStates ( veh ,- 1 ,- 1 , 1 )
elseif opona == 4 then
setVehicleWheelStates ( veh ,- 1 ,- 1 ,- 1 , 1 )
end
end )
Prosz? o pomoc :(
Wysłany: 2017-10-08, 14:35
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
local kolczatki = {}
local cuboidy = {}
local pojazdy = {[ 598 ]= true ,[ 411 ]= true ,[ 597 ]= true ,[ 451 ]= true , [ 560 ]= true ,}
local odporny = {}
addEventHandler ( "onPlayerLogin" , root ,function( prevAcc , currAcc , auto )
if getElementData ( source , 'player:duty' ) and getElementData ( source , 'player:duty' )== 'SAPD' then
bindKey ( source , "x" , "down" , postawkolczatke )
bindKey ( source , "c" , "down" , usunkolczatke )
end
end )
function postawkolczatke ( plr , key , keyState )
local veh = getPedOccupiedVehicle ( plr )
if pojazdy [ getElementModel ( veh )] then
setElementData ( plr , "odporny" , true )
triggerClientEvent ( plr , "znajdzmiejsce" , plr )
if odporny [ plr ] then
killTimer ( odporny [ plr ])
end
odporny [ plr ] = setTimer (function()
setElementData ( plr , "odporny" , false )
odporny [ plr ] = nil
end , 1000 , 1 )
end
end
addEvent ( "postaw" , true )
addEventHandler ( "postaw" , root ,function( x , y , z , rx , ry , rz )
if kolczatki [ source ] then
destroyElement ( kolczatki [ source ])
kolczatki [ source ] = nil
destroyElement ( cuboidy [ source ])
cuboidy [ source ] = nil
end
local kolczatka = createObject ( 2899 , x , y , z - 0.3 , rx , ry , rz + 90 ) -- 2899 , 2892
local cuboid = createColSphere ( x , y , z - 0.3 , 2.5 )
cuboidy [ source ] = cuboid
kolczatki [ source ] = kolczatka
end )
function usunkolczatke ( plr , key , keyState )
if source then
plr = source
end
if kolczatki [ plr ] then
destroyElement ( kolczatki [ plr ])
kolczatki [ plr ] = nil
destroyElement ( cuboidy [ plr ])
cuboidy [ plr ] = nil
if odporny [ plr ] then
killTimer ( odporny [ plr ])
odporny [ plr ] = nil
end
end
end
addEventHandler ( "onPlayerQuit" , root , usunkolczatke )
addEventHandler ( "onColShapeHit" , resourceRoot ,function( el , md )
if getElementType ( el ) ~= "player" or not md then return end
if getElementData ( el , "odporny" ) then return end
local veh = getPedOccupiedVehicle ( el )
if veh then
local x , y , z = getElementPosition ( source )
triggerClientEvent ( el , "sprawdzajopony" , el , x , y )
end
end )
addEventHandler ( "onColShapeLeave" , resourceRoot ,function( el , md )
if getElementType ( el ) ~= "player" or not md then return end
if getElementData ( el , "odporny" ) then return end
local veh = getPedOccupiedVehicle ( el )
if veh then
triggerClientEvent ( el , "przestansprawdzacopony" , el )
end
end )
addEvent ( "przebijopone" , true )
addEventHandler ( "przebijopone" , root ,function( opona )
local veh = getPedOccupiedVehicle ( source )
if opona == 1 then
setVehicleWheelStates ( veh , 1 )
elseif opona == 2 then
setVehicleWheelStates ( veh ,- 1 , 1 )
elseif opona == 3 then
setVehicleWheelStates ( veh ,- 1 ,- 1 , 1 )
elseif opona == 4 then
setVehicleWheelStates ( veh ,- 1 ,- 1 ,- 1 , 1 )
end
end )
Wysłany: 2017-10-08, 15:15
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Niestety dalej nie dzia?a
Wysłany: 2017-10-08, 15:41
Yokosik
Wiek: 25 Na forum: 3629 dni Posty: 58
Nick w MP: Yokosik
Piwa : 1048
Podczas logowania na frakcje sapd s? ustawiane wymagane elementdaty?
Wysłany: 2017-10-08, 16:03
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
wszystko jest dobrze ustawione
[ Dodano : 2017-10-08, 16:03 ]
Testowa?em inne, to da?o si? stawia? ale nie da?o si? usuwa?.
[ Dodano : 2017-10-13, 11:58 ]
Pomo?e kto??
Tagi: kolczatka
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: