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

Wysłany: 2014-09-08, 15:59


maniek0611







Wiek: 36
Na forum: 4684 dni
Posty: 7



Respekt: 50

Witam mo?e kto? mi pom?c z markierami ? Mianowicie chodzi mi o to, aby pojawi? si? marker a w nim bro? kt?ra mo?e wzi?? tylko policja

Marker 2. Chodzi o to ?eby si? wy?wietla?o menu w nim i pisa?o podejmij prace i aktywowane komend? /loginpolicja.

Za pomoc :piwo: :piwo: :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-08, 16:19


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

maniek0611, 1.
local mx, my, mz = 1, 2, 3
local Marker = createMarker ( mx, my, mz, "cylinder", 1.5, 255, 255, 0, 170 )
local ID1 = "5" --//Podaj ID Broni

function isPlayerInACL ( player, acl )
    local account = getPlayerAccount ( player )
    if ( isGuestAccount ( account ) ) then
        return false
    end
        return isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup ( acl ) )
end

function isPlayerInTeam(player, team)
    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

function Markers (hitElement, matchingDimension)
local ElementType = getElementType( hitElement )
    if ElementType == "player" then
        if isPlayerInACL(ElementType, "Policja") and isPlayerInTeam(ElementType, "Policja") then
        giveWeapon(ElementType, ID1, 50000)
        local Model1 = getWeaponNameFromID ( ID1 )
        outputChatBox("Wzo?e? bro? Policyjn?: "..Model1.."", ElementType, 0, 0, 200)
        else
        --//Nie nale?ysz do Policji
        end 
    end
end
addEventHandler( "onMarkerHit", Marker, Markers )


2.
local mx, my, mz = 1, 2, 3
local Marker = createMarker ( mx, my, mz, "cylinder", 1.5, 255, 255, 0, 170 )

function isPlayerInACL ( player, acl )
    local account = getPlayerAccount ( player )
    if ( isGuestAccount ( account ) ) then
        return false
    end
        return isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup ( acl ) )
end

function Markers (hitElement, matchingDimension)
local ElementType = getElementType( hitElement )
    if ElementType == "player" then
        if isPlayerInACL(ElementType, "Policja")  then
        outputChatBox("Wpisz Komende /loginpolicja aby si? zalogowa?.", root, 0, 0, 200)
        else
        --//Nie nale?ysz do Policji
        end 
    end
end
addEventHandler( "onMarkerHit", Marker, Markers )

function zaloguj (thePlayer)
if isElementWithinMarker ( thePlayer, Marker ) then
    if isPlayerInACL(ElementType, "Policja")  then
    outputChatBox("Zalogowa?e? si? do policji", thePlayer, 255, 0, 0)
    setPlayerTeam ( thePlayer, "Policja" ) 
    else
    outputChatBox("Nie nale?ysz do Policji", thePlayer, 255, 0, 0)
    end
else
outputChatBox("Nie jeste? w Markerze", thePlayer, 255, 0, 0)
end
end
addCommandHandler("loginpolicja", zaloguj)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-08, 16:38


maniek0611







Wiek: 36
Na forum: 4684 dni
Posty: 7



Respekt: 50

Dzi?ki za szybk? odpowied?, wszystko ?miga, ale
w 2 chodzi?o mi o panel i ?eby by? tam przycisk "Podejmij Prace" i aktywowa?o by si? to komend? "/loginpolicja"

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-08, 16:40


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

maniek0611, ja nie b?de ci jeszcze paneli robi?..... ju? tak i tak zrobi?em za ciebie du?o. Gdzie jest moje PIWO !! :D

Postaw piwo autorowi tego posta
 

 
Tagi: markery
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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