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

Wysłany: 2014-11-29, 04:04


LordKamis







Wiek: 26
Na forum: 4481 dni
Posty: 107

Piwa: 190

Respekt: 60

Witam chcia?bym aby marker dzia?a? tylko dla odpowiedniego teamu , ?eby by? ale po wej?ciu gracze z nie odpowiednim teamem wyskakiwa?a wiadomo??.Za pomoc piwko :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 10:13


Dixers

No-Life






Wiek: 26
Na forum: 4453 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Mo?na zrobi? te? przez ACL


Więcej informacji znajdziesz w Wikipedii MTA:


isObjectInACLGroup


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 11:41


KukiX







Wiek: 34
Na forum: 6859 dni
Posty: 567

Piwa: 17560

Respekt: 160
Respekt: 160Respekt: 160

Mo?esz zrobi? w ten spos?b:

if getPlayerTeam(gracz) == getTeamFromName("Policja") then
    outputChatBox("jestes w druzynie policja",gracz)
else
    outputChatBox("nie jestes w druzynie policja",gracz)
end

Oczywi?cie to jest tylko przyk?ad.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 16:04


Tostuch







Wiek: 28
Na forum: 5072 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

addEventHandler("onMarkerHit", root, function(el)
 if getElementType(el) == "player" then
  if getPlayerTeam(el) == getTeamFromName("Team") then
   outputChatBox("Jeste? w teamie 'Team'.", el)
  else
   outputChatBox("Nie jeste? w teamie 'Team'.", el)
  end
 end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 21:33


LordKamis







Wiek: 26
Na forum: 4481 dni
Posty: 107

Piwa: 190

Respekt: 60

Tostuch, Ech zawsze mam z tym problem gdzie tu wstawi? marker ?
addEventHandler("onMarkerHit", root, function(el)
 if getElementType(el) == "player" then
  if getPlayerTeam(el) == getTeamFromName("Team") then
   outputChatBox("Jeste? w teamie 'Team'.", el)
  else
   outputChatBox("Nie jeste? w teamie 'Team'.", el)
  end
 end
end)



Bo w przypadku KukiX, to wiem gdzie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 21:42


Tostuch







Wiek: 28
Na forum: 5072 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

To m?j b??d wybacz, niedopatrzy?em :D

addEventHandler("onMarkerHit", root, function(el)
if source == NAZWAMARKERA then
 if getElementType(el) == "player" then
  if getPlayerTeam(el) == getTeamFromName("Team") then
   outputChatBox("Jeste? w teamie 'Team'.", el)
  else
   outputChatBox("Nie jeste? w teamie 'Team'.", el)
  end
 end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 21:59


LordKamis







Wiek: 26
Na forum: 4481 dni
Posty: 107

Piwa: 190

Respekt: 60

Tostuch, Nie wiem czemu nie dzia?a chce ?eby to si? w??czy?o je?li gracz wejdzie w marker "marker" i b?dzie w teamie "Policja

addEventHandler( "onMarkerHit", getResourceRootElement( getThisResource( ) ),
    function( player, dimension )
        if dimension and getElementType( player ) == "player" then
            local vehicle = getPlayerOccupiedVehicle( player )
            if vehicle then
                local driver = getVehicleController( vehicle )
                if driver == player and not getVehicleInModShop( source ) then
                    for k,v in ipairs( modShops ) do
                        if modShops[ k ].marker == source and getElementType( vehicle ) == "vehicle" then
                            timers[ vehicle ] = setTimer( unfreezeVehicleInModShop, 60000 * TIME_IN_MODSHOP, 1, vehicle )
                            timersClient[ vehicle ] = setTimer( triggerClientEvent, 60000 * TIME_IN_MODSHOP - 200, 1, driver, "modShop_clientResetVehicleUpgrades", driver )
                            setModShopBusy( source, vehicle )
                            freezVehicleInModShop( vehicle, modShops[ k ].marker )
                            triggerClientEvent( driver, "onClientPlayerEnterModShop", player, vehicle, getPlayerMoney( player ), modShops[ k ].name )
                        end
                    end
                end
            end
        end
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 22:49


Tostuch







Wiek: 28
Na forum: 5072 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

addEventHandler( "onMarkerHit", root,
    function( player, dimension )
if source == marker then
        if dimension and getElementType( player ) == "player" then
            local vehicle = getPlayerOccupiedVehicle( player )
            if vehicle then
                local driver = getVehicleController( vehicle )
                if driver == player and not getVehicleInModShop( source ) and getPlayerTeam(driver) == getTeamFromName("Policja") then
                    for k,v in ipairs( modShops ) do
                        if modShops[ k ].marker == source and getElementType( vehicle ) == "vehicle" then
                            timers[ vehicle ] = setTimer( unfreezeVehicleInModShop, 60000 * TIME_IN_MODSHOP, 1, vehicle )
                            timersClient[ vehicle ] = setTimer( triggerClientEvent, 60000 * TIME_IN_MODSHOP - 200, 1, driver, "modShop_clientResetVehicleUpgrades", driver )
                            setModShopBusy( source, vehicle )
                            freezVehicleInModShop( vehicle, modShops[ k ].marker )
                            triggerClientEvent( driver, "onClientPlayerEnterModShop", player, vehicle, getPlayerMoney( player ), modShops[ k ].name )
                        end
                    end
                end
            end
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-29, 23:12


LordKamis







Wiek: 26
Na forum: 4481 dni
Posty: 107

Piwa: 190

Respekt: 60

Tostuch, Nadal nic, nie wa?ne czy jestem w teamie po wjechaniu nic si? nie dzieje. W db3 nic niema.

Postaw piwo autorowi tego posta
 

 
Tagi: marker :: działa :: 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