Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-09-06, 10:04


adisonboss







Wiek: 23
Na forum: 3331 dni
Posty: 237

Piwa: 6

Respekt: 50

Witam mam problem ze skryptem na wzi?cie skina. Ot?? w og?le skrypt nie pojawia znacznika do wzi?cia skina. Dodam i? robi?em ju? podobny skrypt i dzia?a? on bez problemowo. Za pomoc piwko i respekt

KOD

pickup createPickup ( -2569.14282479.9202614.56875012750) --Policja

addEventHandler "onPickupHit"pickup, function(element)
    if isObjectInACLGroup ("user."..getAccountName getPlayerAccount element ) ), aclGetGroup "PR" ) ) then
            cywilt getTeamFromName "CYWILE" )
            setPlayerTeam elementcywilt )
        if getAccountData getPlayerAccount element ), "stary:skin" then
            id tonumber getAccountData getPlayerAccount element ), "stary:skin" ) )
            setElementModel elementid ) 
            setAccountData getPlayerAccount element ), "stary:skin"false )
        else
            skin tonumber getElementModel element ) )
            setAccountData getPlayerAccount element ), "stary:skin"skin )
            setElementModel element118 )
end
    end
    end)





DB3
https://imgur.com/a/X27ZnOI

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-06, 11:52


mtm

</3






Wiek: 26
Na forum: 3716 dni
Posty: 181

Piwa: 252

Respekt: 70

hej

spr?buj:

cside:

pickup createPickup ( -2569.14282479.9202614.56875012750) --Policja
setElemendData(pickup"policepickup"true)


sside:

addEventHandler "onPickupHit"root,
    function(element)
        if getElementData(source'policepickup'then
            if isObjectInACLGroup ("user."..getAccountName getPlayerAccount element ) ), aclGetGroup "PR" ) ) then
                    cywilt getTeamFromName "CYWILE" )
                    setPlayerTeam elementcywilt )
                if getAccountData getPlayerAccount element ), "stary:skin" then
                    id tonumber getAccountData getPlayerAccount element ), "stary:skin" ) )
                    setElementModel elementid ) 
                    setAccountData getPlayerAccount element ), "stary:skin"false )
                else
                    skin tonumber getElementModel element ) )
                    setAccountData getPlayerAccount element ), "stary:skin"skin )
                    setElementModel element118 )
                end
            end
        end
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-06, 16:04


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

@mtm: je?li nie wiesz w czym polega problem, nie pomagaj na si??, tym bardziej je?li masz problemy z LUA.

Problem polega na tym, ?e w typie pickupa ustawi?e? typ na 'zdrowie' a nie na typ 'custom'.

Jest to czwarty argument (3 to custom, 0 to zdrowie).
Wtedy tworzysz event onPickupUse i funkcj? do niego co ma sie zdarzy? po u?yciu owego pickup'u.

Gotowy kod po stronie 'server':


local pickup createPickup(-2569.14282479.9202614.56875312750) --Policja

addEventHandler("onPickupUse"pickup, function(element)
    if isObjectInACLGroup ("user." .. getAccountName getPlayerAccount element ) ), aclGetGroup "PR" ) ) then
        setPlayerTeam elementgetTeamFromName "CYWILE" ) )
        if getAccountData getPlayerAccount element ), "stary:skin" then
            local id tonumber getAccountData getPlayerAccount element ), "stary:skin" ) )
            setElementModel elementid ) 
            setAccountData getPlayerAccount element ), "stary:skin"false )
        else
            local skin tonumber getElementModel element ) )
            setAccountData getPlayerAccount element ), "stary:skin"skin )
            setElementModel element118 )
        end
    end
end)



Więcej informacji znajdziesz w Wikipedii MTA:

createPickup



Więcej informacji znajdziesz w Wikipedii MTA:

onPickupUse


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
adisonboss
Wysłany: 2018-09-06, 17:40


adisonboss







Wiek: 23
Na forum: 3331 dni
Posty: 237

Piwa: 6

Respekt: 50

Dzi?ki dzia?a do zamkni?cia

Postaw piwo autorowi tego posta
 

 
Tagi: pickup :: skina
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Pickup skina Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku