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

Wysłany: 2012-09-02, 11:44


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Witam zrobi?em sobie teamy do mojego rpg i p?? nie dzia?a
oto kod :
mechanic = createTeam ( "Pomoc Drogowa", 139, 0, 139 )
medic = createTeam ( "Pogotowie", 32, 178, 170 )
Policja = createTeam ( "Policja", 0, 0, 255 )
Swat = createTeam ( "Swat", 0, 0, 255 )
salon = createTeam ( "Salon samochodowy", 255, 69, 0 )
taxi = createTeam ( "Taxi", 255, 215, 0 )
ammo = createTeam ( "Ammonation", 47, 79, 79 )
ultra = createTeam ( "Ultra-Trans", 153, 255, 0 )
Niebieska = createTeam ( "Niebiska Mafia", 0, 0, 150 )
Czarna = createTeam ( "Czarna Mafia", 0, 0, 0 )
--55


function mechanic1 ( thePlayer )    
  local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Pomoc Drogowa" ) ) then
    setPlayerTeam ( thePlayer, mechanic )
      giveWeapon ( thePlayer, 12, 10000 )
      setPedArmor ( thePlayer, 100 )
      setElementModel ( thePlayer, 50 )
      setElementPosition ( thePlayer, -1522.34, 682.99, 7.2 )
    setPlayerNametagColor ( thePlayer, 139, 0, 139 )
else
outputChatBox( "Nie jestes pracownikiem PD", getRootElement())
end
end
addCommandHandler ( "loginpd", mechanic1 )


function u1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )        
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Salon samochodowy" ) ) then
    setPlayerTeam ( thePlayer, salon )
      giveWeapon ( thePlayer, 12, 10000 )
      setPedArmor ( thePlayer, 100 )
      setElementModel ( thePlayer, 111 )
      setElementPosition ( thePlayer, -1954.25, 463.93, 7.18  )
    setPlayerNametagColor ( thePlayer, 255, 69, 0 )
else
outputChatBox( "Nie jestes pracownikiem salonu", getRootElement())
end
end
addCommandHandler ( "loginsalon", u1 )




function pogotowie1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Pogotowie" ) ) then
    setPlayerTeam ( thePlayer, medic )
      giveWeapon ( thePlayer, 14, 10000 )
      setPedArmor ( thePlayer, 100 )
      setElementModel ( thePlayer, 274 )
      setElementPosition ( thePlayer, -2577.8974609375 , 584.50665283203, 14.102350234985 )
    setPlayerNametagColor ( thePlayer, 32, 178, 170 )
else

outputChatBox( "Nie jestes pracownikiem Pogotowia", getRootElement())
end
end
addCommandHandler ( "loginpogo", pogotowie1 )

function Policja ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Policja" ) ) then
    setPlayerTeam ( thePlayer, Policja )
    giveWeapon ( thePlayer, 3, 10000 )
    giveWeapon ( thePlayer, 30, 10000 )
    giveWeapon ( thePlayer, 24, 10000 )
      setPedArmor ( thePlayer, 50 )
      setElementModel ( thePlayer, 282 )
      setElementPosition ( thePlayer, -1615.04, 682.99, 7.2 )
    setPlayerNametagColor ( thePlayer, 0, 0, 255 )
else
outputChatBox( "Nie jestes pracownikiem Policji", getRootElement())
end
end
addCommandHandler ( "loginpoli", Policja )

function Swat1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Swat" ) ) then
    setPlayerTeam ( thePlayer, Swat )
    giveWeapon ( thePlayer, 3, 10000 )
    giveWeapon ( thePlayer, 30, 10000 )
    giveWeapon ( thePlayer, 24, 10000 )
      setPedArmor ( thePlayer, 50 )
      setElementModel ( thePlayer, 282 )
      setElementPosition ( thePlayer, -1806.56, 531, 35 )
    setPlayerNametagColor ( thePlayer, 0, 0, 255 )
else
outputChatBox( "Nie jestes pracownikiem Policji", getRootElement())
end
end
addCommandHandler ( "loginswat", Swat1 )


function taxi1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Taxi" ) ) then
    setPlayerTeam ( thePlayer, taxi )
      setElementModel ( thePlayer, 73 )
      setElementPosition ( thePlayer, -1712 , 997, 17 )
    setPlayerNametagColor ( thePlayer, 255, 215, 0 )
else
outputChatBox( "Nie jestes pracownikiem Taxi", getRootElement())
end
end
addCommandHandler ( "logintaxi", taxi1 )

function ammo1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Ammonation" ) ) then
    setPlayerTeam ( thePlayer, ammo )
      setElementModel ( thePlayer, 73 )
      setElementPosition ( thePlayer, -2051 , 90, 36 )
    setPlayerNametagColor ( thePlayer, 47, 79, 79 )

else

outputChatBox( "Nie jestes pracownikiem Ammonation", getRootElement())
end
end
addCommandHandler ( "loginammo", ammo1 )

function ultra1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Petrol" ) ) then
    setPlayerTeam ( thePlayer, ultra )
      setElementModel ( thePlayer, 73 )
      setElementPosition ( thePlayer, -1513.15, 463.93, 7.18 )
    setPlayerNametagColor ( thePlayer, 153, 255, 0 )
else
    outputChatBox( "Nie jestes pracownikiem Petrol", getRootElement())
end
end
addCommandHandler ( "loginpetrol", ultra1 )


function Niebieska1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Niebieska" ) ) then
    setPlayerTeam ( thePlayer, Niebieska )
    giveWeapon ( thePlayer, 3, 10000 )
    giveWeapon ( thePlayer, 30, 10000 )
    giveWeapon ( thePlayer, 24, 10000 )
      setPedArmor ( thePlayer, 50 )
      setElementModel ( thePlayer, 282 )
      setElementPosition ( thePlayer, -2200.12, 75.85, 35.33 )
    setPlayerNametagColor ( thePlayer, 0, 0, 255 )
else

outputChatBox( "Nie jestes w gangu Niebieska Mafia", getRootElement())
end
end
addCommandHandler ( "loginn", Niebieska1 )


function Czarna1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Czarna" ) ) then
    setPlayerTeam ( thePlayer, Czarna )
    giveWeapon ( thePlayer, 3, 10000 )
    giveWeapon ( thePlayer, 30, 10000 )
    giveWeapon ( thePlayer, 24, 10000 )
      setPedArmor ( thePlayer, 50 )
      setElementModel ( thePlayer, 282 )
      setElementPosition ( thePlayer, -1522.43, 1084.90, 7.93 )
    setPlayerNametagColor ( thePlayer, 0, 0, 255 )
else

outputChatBox( "Nie jestes w gangu Czarna Mafia", getRootElement())
end
end
addCommandHandler ( "logincz", Czarna1 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-02, 12:23


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Nosz...Specjalnie robi?em ten temat: http://www.gtao.pl/rady-dla-piszacych-vt68895.htm
Mo?e ?askawie napiszesz co nie dzia?a? Nie musieliby?my sprawdza? ca?ego kodu?!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-02, 15:11


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611


function mechanic1 ( thePlayer )    
  local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Pomoc Drogowa" ) ) then
    setPlayerTeam ( thePlayer, mechanic )
      giveWeapon ( thePlayer, 12, 10000 )
      setPedArmor ( thePlayer, 100 )
      setElementModel ( thePlayer, 50 )
      setElementPosition ( thePlayer, -1522.34, 682.99, 7.2 )
    setPlayerNametagColor ( thePlayer, 139, 0, 139 )
else
outputChatBox( "Nie jestes pracownikiem PD", getRootElement())
end
end
addCommandHandler ( "loginpd", mechanic1 )


function u1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )        
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Salon samochodowy" ) ) then
    setPlayerTeam ( thePlayer, salon )
      giveWeapon ( thePlayer, 12, 10000 )
      setPedArmor ( thePlayer, 100 )
      setElementModel ( thePlayer, 111 )
      setElementPosition ( thePlayer, -1954.25, 463.93, 7.18  )
    setPlayerNametagColor ( thePlayer, 255, 69, 0 )
else
outputChatBox( "Nie jestes pracownikiem salonu", getRootElement())
end
end
addCommandHandler ( "loginsalon", u1 )




function pogotowie1 ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Pogotowie" ) ) then
    setPlayerTeam ( thePlayer, medic )
      giveWeapon ( thePlayer, 14, 10000 )
      setPedArmor ( thePlayer, 100 )
      setElementModel ( thePlayer, 274 )
      setElementPosition ( thePlayer, -2577.8974609375 , 584.50665283203, 14.102350234985 )
    setPlayerNametagColor ( thePlayer, 32, 178, 170 )
else

outputChatBox( "Nie jestes pracownikiem Pogotowia", getRootElement())
end
end
addCommandHandler ( "loginpogo", pogotowie1 )

function Policja ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Policja" ) ) then
    setPlayerTeam ( thePlayer, Policja )
    giveWeapon ( thePlayer, 3, 10000 )
    giveWeapon ( thePlayer, 30, 10000 )
    giveWeapon ( thePlayer, 24, 10000 )
      setPedArmor ( thePlayer, 50 )
      setElementModel ( thePlayer, 282 )
      setElementPosition ( thePlayer, -1615.04, 682.99, 7.2 )
    setPlayerNametagColor ( thePlayer, 0, 0, 255 )
else
outputChatBox( "Nie jestes pracownikiem Policji", getRootElement())
end
end
addCommandHandler ( "loginpoli", Policja )


Prosz? o pomoc daje piwka

Cywile zrobi?em team cywile i teraz cos nie dzia?a

function Cywile1 ( thePlayer )    
  local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
  if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Default" ) ) then
    setPlayerTeam ( thePlayer, Cywile )
      setElementModel ( thePlayer, 0 )
      setElementPosition ( thePlayer, -1522.34, 682.99, 7.2 )
    setPlayerNametagColor ( thePlayer, 0, 0, 0 )
end
end
addEventHandler ( "onPlayerJoin", getRootElement(), Cywile1 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-02, 15:39


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

W twoim kodzie nie ma teamu "Cywile", to po pierwsze po drugie po co blokada na ACL? My?la?em ?e do cywil?w wszyscy maj? dost?p.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-02, 15:43


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Ziomek11, a addEventHandler ( "onPlayerJoin", getRootElement(), Cywile1 ) jest dobre ??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-02, 21:30


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

A dlaczego mia?oby by? z?e? Zr?b ten team + ta blokada zb?dna, chocia? nie wiem jak to masz zaplanowane jak ma dzia?a? i b?dzie luksio.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-03, 11:05


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Ziomek11, jak kto? wejdzie i si? zaloguje w panelu logowania to ?eby przenosi?o

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-03, 13:51


Jacob

Głupiomądry






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

Piwa: 786

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

luki123luki123, zdarzenie onPlayerLogin + setPlayerTeam.

Mo?esz r?wnie? w swoim panelu logowania przypisa? do funkcji, kt?ra loguje setPlayerTeam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-03, 15:04


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Jacob, ok dzia?a a te inne teamy co s? na tab a nie da si? zalogowa?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-03, 18:38


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

setPlayerTeam(player, getTeamFromName("Gracze"))


W miejsce Gracze wiadome, nazwa teamu. DOK?ADNA NAZWA.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-03, 19:37


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Ziomek11, dalej nic nie pisz? czy jestem w teamie ??


Policja = createTeam ( "Policja", 0, 0, 255 )





function Policja ( thePlayer )
  local accName2 = getAccountName ( getPlayerAccount ( thePlayer ) )    
  if isObjectInACLGroup ( "user." .. accName2, aclGetGroup ( "Policja" ) ) then
    setPlayerTeam(thePlayer, getTeamFromName("Policja"))
    giveWeapon ( thePlayer, 3, 10000 )
    giveWeapon ( thePlayer, 30, 10000 )
    giveWeapon ( thePlayer, 24, 10000 )
      setPedArmor ( thePlayer, 50 )
      setElementModel ( thePlayer, 282 )
      setElementPosition ( thePlayer, -1615.04, 682.99, 7.2 )
    setPlayerNametagColor ( thePlayer, 0, 0, 255 )
else
outputChatBox( "Nie jestes pracownikiem Policji", getRootElement())
end
end
addCommandHandler ( "loginpoli", Policja )


Postaw piwo autorowi tego posta
 

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