Wysłany: 2018-08-15, 20:08
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Witam all . Mam pytanie odno?nie tego ?e jak kto? wyjdzie z graczy to torba znika , nie wiem dlaczego , naprawicie mi to ?
function pacholek ( localPlayer )
if getElementData ( localPlayer , "frakcja" ) == "PR" then
pacholekk = createObject ( 1210 , 0 , 0 , 0 , 0 , 0 , 0 )
attachElements ( pacholekk , localPlayer , 0.2 ,- 0.09 ,- 0.3 , 0 , 0 , 90 )
end
end
addCommandHandler ( "torba" , pacholek )
function usuntorbe ( localPlayer )
destroyElement ( pacholekk , localPlayer )
end
addCommandHandler ( "usuntorbe" , usuntorbe )
function postaw ( localPlayer )
detachElements ( pacholekk , localPlayer )
end
addCommandHandler ( "postawtorbe" , postaw )
addEventHandler ( "onPlayerQuit" , getRootElement (), function( source )
destroyElement ( pacholekk , source )
end )
Podpis
Uczeń LUA . Mapper MTA.
Wysłany: 2018-08-15, 20:55
BoomEq
Wiek: 35 Na forum: 3522 dni Posty: 101
Nick w MP: BoomEqqq
Piwa : 20
function pacholek ( localPlayer )
if getElementData ( localPlayer , "frakcja" ) == "PR" then
pacholekk = createObject ( 1210 , 0 , 0 , 0 , 0 , 0 , 0 )
attachElements ( pacholekk , localPlayer , 0.2 ,- 0.09 ,- 0.3 , 0 , 0 , 90 )
end
end
addCommandHandler ( "torba" , pacholek )
function usuntorbe ( localPlayer )
destroyElement ( pacholekk , localPlayer )
end
addCommandHandler ( "usuntorbe" , usuntorbe )
function postaw ( localPlayer )
detachElements ( pacholekk , localPlayer )
end
addCommandHandler ( "postawtorbe" , postaw )
end )
Wysłany: 2018-08-15, 23:19
Remix110
Pewna osóbka :3
Wiek: 40 Na forum: 3663 dni Posty: 291
Nick w MP: GoodNight
Piwa : 15
BoomEq , co to mia?o zmieni?? Usun??e? tylko, ?e po wyj?ciu dowolnego gracza usuwa si? A co do tego masz ustawione getRootElement i b?dzie ci bra? jak dowolny gracz wyjdzie we? gracza kt?ry to postawi? aby usuwa?o.
Podpis
[you]
pomogłem?
Możesz dać piwko, przyda się na imprezę
Wysłany: 2018-08-16, 03:58
Adis.exe
LUA Developer
Wiek: 23 Na forum: 3498 dni Posty: 292
Nick w MP: Adiś.exe
Piwa : 997
Poczytaj, tam jest napisane co to jest source, z reszt? z przyk?adu mo?esz wywnioskowa? dlaczego usuwa si? jak kto? wyjdzie z serwera
I ten dzia? jest po to aby ci kto? pom?g? podpowiedzia?, a nie "naprawi? ci" i odwali? za Ciebie robot?.
Podpis
KONTAKT:
GG: 60968224
Discord: Adiś.exe#3828
Użytkownik : 05.11.2016
GTAO Member : 20.02.2019
Support-Team : 25.07.2018
Support-Team : 19.01.2019
Test Mod : 08.02.2019
Wysłany: 2018-08-16, 09:26
Qwertick
Coming soon...
Wiek: 23 Na forum: 3577 dni Posty: 472
Nick w MP: Qwertick
Piwa : 2726
Zobacz to function pacholek ( localPlayer )
if getElementData ( localPlayer , "frakcja" ) == "PR" then
pacholekk = createObject ( 1210 , 0 , 0 , 0 , 0 , 0 , 0 )
attachElements ( pacholekk , localPlayer , 0.2 ,- 0.09 ,- 0.3 , 0 , 0 , 90 )
pacholek [ source ] = pacholekk
end
end
addCommandHandler ( "torba" , pacholek )
function usuntorbe ()
destroyElement ( pacholek [ source ])
end
addCommandHandler ( "usuntorbe" , usuntorbe )
function postaw ()
detachElements ( pacholek [ source ])
end
addCommandHandler ( "postawtorbe" , postaw )
pacholek [ source ] = {}
addEventHandler ( "onPlayerQuit" , getRootElement (), function()
if pacholek [ source ] then
if isElement ( pacholek [ source ]) then destroyElement ( pacholek [ source ] end
end
end )
Wysłany: 2018-08-16, 20:22
Hemoglobina
Tylko Hema
Wiek: 29 Na forum: 3397 dni Posty: 89
Nick w MP: Answer
Piwa : 1386
Polecam pisa? po stronie serwera.
Na jednym przyk?adzie poka?e Tobie jak poradzi? sobie z reszt?.
torba = {}
torbamodel = 1210
addCommandHandler ( "torba" , function( player , cmd )
if tostring ( getElementData ( player , "frakcja" )) == "PR" then
torba [ player ] = createObject ( torbamodel , 0 , 0 , 0 , 0 , 0 , 0 )
attachElements ( torba [ player ], player , 0.2 ,- 0.09 ,- 0.3 , 0 , 0 , 90 )
end
end )
addEventHandler ( "onPlayerQuit" , getRootElement (), function()
if tostring ( getElementData ( source , "frakcja" )) == "PR" then
for _ , obj in ipairs ( getElementsByType ( "object" , resourceRoot )) do
if getElementModel ( obj ) == torbamodel then
destroyElement ( torba [ source ])
end
end
end
end )
Masz praktycznie to co chcia?e?.
Tagi: torba :: która :: zle :: znika
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: