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

Wysłany: 2014-09-13, 19:25


xBolekk







Wiek: 24
Na forum: 4474 dni
Posty: 113
Nick w MP: Bolek.

Piwa: 190

Respekt: 60

Siemka, mam taki kod, kt?ry po wej?ciu w pickup nadaje skin, lecz chcia?bym, aby ten skin mo?na by?oby pobra? tylko je?li jest si? w teamie SAPD.

Oto kod, pom??cie, prosz?!

ID_SKINA 280

pickup createPickup 261.22680664063111.421249389651004.6171875312750setElementInterior (pickup10)

addEventHandler "onPickupHit"pickup, function(hitElement,matchingDimensionsetElementModel hitElementID_SKINA end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-13, 19:46


Blur







Wiek: 28
Na forum: 4298 dni
Posty: 47
Nick w MP: Blu

Piwa: 2

Respekt: 50


skinSa 280

pickup createPickup 261.22680664063111.421249389651004.6171875312750setElementInterior (pickup10)

addEventHandler "onPickupHit"pickup, function(hitElement,matchingDimension) 
if getPlayerTeam(hitElement) == "SAPD" then
setElementModel hitElementskinSa end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-13, 19:49


xBolekk







Wiek: 24
Na forum: 4474 dni
Posty: 113
Nick w MP: Bolek.

Piwa: 190

Respekt: 60

Nie dziala :/ .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-13, 19:51


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Blur, troche ?le bo jak nie ma teamu SAPD to we?mie ten skin polecam t? funkcj?.

Więcej informacji znajdziesz w Wikipedii MTA:

IsPlayerInTeam


Kod:
ID_SKINA 280
function isPlayerInTeam(playerteam)
    assert(isElement(player) and getElementType(player) == "player""Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]")
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]")
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true)))
end

pickup createPickup 261.22680664063111.421249389651004.6171875312750setElementInterior (pickup10)

addEventHandler "onPickupHit"pickup, function(hitElement,matchingDimension)
if isPlayerInTeam(player"SAPD"then 
setElementModel hitElementID_SKINA end
end
end


[ Dodano: 2014-09-13, 19:53 ]
@Upade:
ID_SKINA 280
function isPlayerInTeam(playerteam)
    assert(isElement(player) and getElementType(player) == "player""Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]")
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]")
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true)))
end

pickup createPickup 261.22680664063111.421249389651004.6171875312750setElementInterior (pickup10)


function(thePlayer)
if isPlayerInTeam(player"SAPD"then 
setElementModel thePlayerID_SKINA end
end
addEventHandler "onPickupHit"pickupPickupfalse)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-13, 20:23


xBolekk







Wiek: 24
Na forum: 4474 dni
Posty: 113
Nick w MP: Bolek.

Piwa: 190

Respekt: 60

Nadal nic

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-13, 20:25


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

xBolekk, usu? false w ostatniej linijce.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-14, 15:56


Zbyklon







Wiek: 50
Na forum: 4290 dni
Posty: 45
Nick w MP: Zbyklon

Piwa: 7

Respekt: 55,3

Pisz? za bolka -- Nadal nie dzia?a

//wycinek z log?w b??du
[2014-09-14 16:03] Skiny-policja restarted successfully
[2014-09-14 16:03] ERROR: Loading script failed: Skiny-policja/skins.lua:12: '' expected near '('
[2014-09-14 16:03] SCRIPT ERROR: Skiny-policja/skins.lua:12: '' expected near '('
[2014-09-14 16:03] Starting Skiny-policja
[2014-09-14 16:03] Resource 'Skiny-policja' changed, reloading and starting
[2014-09-14 16:03] Stopping Skiny-policja
[2014-09-14 16:03] ADMIN: Resource 'Skiny-policja' restarted by AeroX

//12 linijka :
function(thePlayer)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-15, 14:24


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

ID_SKINA 280

pickup createPickup 261.22680664063111.421249389651004.6171875312750setElementInterior (pickup10)

addEventHandler "onPickupHit"pickup,
    function ( hitElementmatchingDimension )
        if ( getElementType hitElement ) == "player" then
            local team getPlayerTeam hitElement )
            if ( team == getTeamFromName "SAPD" ) ) then
                setElementModel hitElementID_SKINA ) 
            end
        end
    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-19, 15:44


xBolekk







Wiek: 24
Na forum: 4474 dni
Posty: 113
Nick w MP: Bolek.

Piwa: 190

Respekt: 60

Blip si? respi jednak nie nadaje skina

Postaw piwo autorowi tego posta
 

 
Tagi: skin :: tylko :: dla :: teamu.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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