Witajcie! mam problemos ;d bo tak pisa?em sobie taki skrpt ?e jak klikn? wyceluj? w auto i klikn? lewym to niszczy auto a prawym naprawia mam o to taki kod lecz nie dzia?a . wgra?em to pod suszrk? kt?r? mam podmianion? na silenced
oto kod
addEventHandler ( "onElementClicked", root,
function ( mouseButton )
local elementType = getElementType ( source )
if ( elementType == "vehicle" ) then
if ( mouseButton == "left" ) then -- niszczenie
destroyElement ( source )
elseif ( mouseButton == "right" ) then -- naprawa
fixVehicle ( source )
end
elseif ( elementType == "player" ) then
local car = getPedOccupiedVehicle ( source )
if ( mouseButton == "left" ) then -- niszczenie
destroyElement ( car )
elseif ( mouseButton == "right" ) then -- naprawa
fixVehicle ( car )
end
end
end
)
[ Dodano: 2014-11-23, 16:04 ]
A najlepsze jest to ?e jak wejde do auta i wejd? do panelu admina i klikne lewy lub prawy to dzia?a ;d nwm co jest ;d
[ Dodano: 2014-11-23, 16:06 ]
wystarczy ?e klikne p i wyceluj? w jakie? auto i mi je niszczy lub naprawia a ja chce ?eby t? suszark? wycelowa? i naprawia?/niszczy? ;d
[ Dodano: 2014-11-23, 16:15 ]
prosze kod ca?y :
function isPedAiming ( thePedToCheck )
if isElement(thePedToCheck) then
if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" then
return true
end
end
end
return false
end
function blockShoot()
if getPedWeapon(localPlayer) == 23 then
toggleControl("fire", false)
else
toggleControl("fire", true)
end
end
addEventHandler("onClientRender", root, blockShoot)
addEventHandler ( "onElementClicked", root,
function ( mouseButton )
local elementType = getElementType ( source )
if ( elementType == "vehicle" ) then
if ( mouseButton == "left" ) then -- niszczenie
destroyElement ( source )
elseif ( mouseButton == "right" ) then -- naprawa
fixVehicle ( source )
end
elseif ( elementType == "player" ) then
local car = getPedOccupiedVehicle ( source )
if ( mouseButton == "left" ) then -- niszczenie
destroyElement ( car )
elseif ( mouseButton == "right" ) then -- naprawa
fixVehicle ( car )
end
end
end
)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach