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

Wysłany: 2015-06-29, 17:53


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Witam mozecie mi poprawic kod?
Chodzi oto ze po wpisaniu /dajmecha nick ma da? do grupy acl Mechanik
a /zabierzmecha nick usuwa z acl Mechanik
Bo jak pisze to nic niema
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Vmech" ) ) then 
if accountName then
local pl = getPlayerFromName(accountName)
if pl then
local account = getPlayerAccount(pl)
local acc = getAccountName(account)
aclGroupAddObject (aclGetGroup("Mechanik"), "user."..acc)
outputChatBox('Da?es Mechanika', thePlayer)
else
outputChatBox('Podany nick jest nieprawid?owy !', thePlayer)
end
end
end
end
addCommandHandler('damecha',dajMecha)

addCommandHandler('zabierzmecha',function(plr, cmd, accountName)
if accountName then
local player = getPlayerFromName(accountName)
local account = getPlayerAccount(player)
local accName = getAccountName(account)
aclGroupRemoveObject (aclGetGroup("Mechanik"), "user."..accName)
outputChatBox('Zabra?es Mechanika', thePlayer)
else
outputChatBox('Podany nick jest nieprawid?owy !', thePlayer)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-30, 00:04


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

mixLoLmix2, to jest jaki? wyci?ty kod. Nawet funkcji zacz?tej nie ma, sprawd? czy dobrze wklei?e?. Po drugie, zauwa?, ?e masz komende '/damecha'.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-30, 16:45


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

no wiem potem zauwazy?em ze jest damecha ale nadal niema

Tak kod jest wyci?ty z innego skryptu.

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-30, 17:37


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

mixLoLmix2, podaj pe?ny kod tych funkcji

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-30, 18:30


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3


prawojazdykatb = { [401]=true, [402]=true, [410]=true, [411]=true, [412]=true, [415]=true, [419]=true, [422]=true, [423]=true, [424]=true,
 [429]=true, [434]=true, [436]=true, [439]=true, [444]=true, [451]=true, [467]=true, [474]=true, [475]=true, [477]=true, [478]=true, [480]=true, 
 [489]=true, [491]=true, [494]=true, [495]=true, [496]=true, [500]=true, [502]=true, [503]=true, [504]=true, [505]=true, [506]=true, [508]=true, 
 [517]=true, [518]=true, [525]=true, [526]=true, [527]=true, [533]=true, [534]=true, [535]=true, [536]=true, [541]=true, [542]=true, [543]=true, 
 [545]=true, [549]=true, [552]=true, [554]=true, [555]=true, [558]=true, [559]=true, [562]=true, [565]=true, [568]=true, [574]=true, [575]=true, 
 [576]=true, [587]=true, [589]=true, [600]=true, [602]=true, [603]=true }
function prawoKatB ( thePlayer, seat, jacked ) 
if seat == 0 then 
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) ) 

if ( prawojazdykatb[getElementModel(source)] ) and not isObjectInACLGroup ( 'user.'..playerName, aclGetGroup ( "PJKB" ) ) then 

cancelEvent()
outputChatBox ("Panie! Potrzebne ci Prawko Kart.B", thePlayer)
end
end
end 
addEventHandler ( 'onVehicleStartEnter', root, prawoKatB )

function dajPrawkoB(thePlayer, commandName, accountName) 

local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "RCON" ) ) then 
if accountName then
local pl = getPlayerFromName(accountName)
if pl then
local account = getPlayerAccount(pl)
local acc = getAccountName(account)
aclGroupAddObject (aclGetGroup("PJKB"), "user."..acc)
outputChatBox('Wyda?e? prawo jazdy', thePlayer)
else
outputChatBox('Podany nick jest nieprawid?owy !', thePlayer)
end
end
end
end
addCommandHandler('dajprawkob',dajPrawkoB)

addCommandHandler('zabierzprawkob',function(plr, cmd, accountName)
if accountName then
local player = getPlayerFromName(accountName)
local account = getPlayerAccount(player)
local accName = getAccountName(account)
aclGroupRemoveObject (aclGetGroup("PJKB"), "user."..accName)
outputChatBox('Zabra?es Prawko', thePlayer)
else
outputChatBox('Podany nick jest nieprawid?owy !', thePlayer)
end
end)


Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Tagi: mechanik
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