Wysłany: 2018-02-02, 20:04
Yami
Mapper / Uczeń LUA
Wiek: 25 Na forum: 3059 dni Posty: 379
Piwa : 97
Siemka
Mia?bym do was pytanko. Poniewa? dopiero ucz? sie LUA i nie do ko?ca wiem jak to zrobi?. Wi?c, da sie zrobi? co? takiego ?e bro? mo?na u?y? w danym miejscu? Ale bro? o danym podtypie, na gm xyzzyrp, ?eby gangi mog?y u?ywa? broni w danym miejscu.
I mia?bym jeszcze jedn? sprawe. Czy da si? zrobi? tak ?eby zmieni? handling dla pojazdu o danym id, nie chodzi mi ?e wszystkie sultany tylko jeden wybrany. Bo np. Jak pobieram jaki? skrypt z gui do zmian? handlingu to po restarcie aut to co tam robi?em znika.
Za pomoc stawiam piwka
Z G?ry Dzi?kuj?
Wysłany: 2018-02-02, 21:15
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
1. robisz colshape o jakims rozmiarze i tam definiujesz jakie bronie sa dozwolone.
2. tworzysz komende gdzie pobierasz auto i sprawdzasz jego id, jezeli sie nie zgadza to return end
Podpis
"amited" napisał/a :
Więcej szczegółów
Wystawiono 1 piw(a):Yami
Wysłany: 2018-02-11, 16:04
Yami
Mapper / Uczeń LUA
Wiek: 25 Na forum: 3059 dni Posty: 379
Piwa : 97
ten colshape to takie cos ta? Tylko trzeba coordy dodac?:
SERVER
Kod:
theZone = false
function shapeHit ( thePlayer )
outputChatBox ( getPlayerName ( thePlayer ) .. " is in the zone!" ) -- display a message in everyone's chat box
end
function setZone ( playerSource, commandName, fX, fY, fZ )
if ( fZ and fY and fX ) then -- check we've got all 3 args we need
local tempCol = createColSphere ( fX, fY, fZ, 10.0 ) -- create a col
if ( tempCol == false ) then -- did the col get created successfully?
outputConsole ( "Syntax is: set_zone <X> <Y> <Z>" ) -- inform the user what the valid syntax is
else
if ( theZone ~= false ) then -- did we already have a zone?
destroyElement ( theZone ) -- if so, destroy it
else
addEventHandler ( "onColShapeHit", theZone, shapeHit ) -- add a handler for the onColShapeHit event
end
theZone = tempCol -- and store the new zone we've made
outputChatBox ( "Zone has moved!" ) -- and tell everyone
end
end
end
addCommandHandler ( "set_zone", setZone ) -- add a console function called set_zone that will trigger the function setZone
CLIENT
Kod:
function createClaymore ( x,y,z, creator )
local x,y,z = getElementPosition ( creator )
local claymoreObject = createObject ( 1945, x, y, z - 1, 0, 0, 90 ) --create an object which looks like a claymore
local claymoreCol = createColSphere ( x, y, z, 1 ) --create a col sphere with radius 1
setElementData ( claymoreCol , "type", "claymore" ) --store the type of colshape so it can be retrieved
setElementData ( claymoreCol, "object", claymoreObject ) --store the object of the claymore
setElementData ( claymoreCol, "creatorPlayer", creator ) --store the person who created it
end
function claymoreHit ( player, matchingDimension )
if getElementData ( source, "type" ) == "claymore" then --ensure its a claymore
--retrieve the object associated to the claymore, and who created it
local claymoreObject = getElementData ( source, "object" )
local claymoreCreator = getElementData ( source, "creatorPlayer" )
--get the position of the claymore
local x,y,z = getElementPosition ( source )
createExplosion ( x,y,z, 12, claymoreCreator ) --create an explosion, associated to the creator, of a small size at the col's position
--destroy the claymore object, and the col shape so it doesnt trigger again.
destroyElement ( claymoreObject )
destroyElement ( source )
end
end
addEventHandler ( "onColShapeHit", getRootElement(), claymoreHit )
[ Dodano : 2018-02-02, 23:02 ]
I z tamtym to mam komende zeby sprawdzic ID auta
Tylko nie mam zielonego pojecia jak zrobic tamto
Wysłany: 2018-02-11, 17:08
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Tworzysz po prostu cuboida za pomoc? ten funkcji
Przy czym do tego dodajesz odpowiednie funkcje, kt?re ma wykonywa? cuboid
Tagi: miejsce :: użycia :: broni
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: