Jump to content

Skrypt nie działa na zdarzenie, ale działa komendą


Recommended Posts

Co robie nie tak? chce aby po wejściu na Serva Gracz zalogował się w team którym jest w ACL

poli = createTeam ( "PGM", 193, 177, 2 )  
  
  
function poli1 ( thePlayer )  
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )  
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "PGM" ) ) then  
setPlayerTeam ( thePlayer, poli )     
setElementPosition ( thePlayer, 1549.84143, -1208.50720, 20.03212 )  
setPlayerNametagColor ( thePlayer, 193, 177, 2 )  
else  
  
outputChatBox( "Nie jestes w tym gangu.", getRootElement())  
end  
end  
addEventHandler("onPlayerLogin",getRootElement(),setpoli1Team)  

a jak daje

addCommandHandler ( "loginpgm", poli1 ) 

zamiast

addEventHandler("onPlayerLogin",getRootElement(),setpoli1Team) 

to działa komendą

Edited by Guest
Link to comment
poli = createTeam ( "PGM", 193, 177, 2 ) 
  
  
function poli1 ( thePlayer ) 
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "PGM" ) ) then 
setPlayerTeam ( thePlayer, poli )     
setElementPosition ( thePlayer, 1549.84143, -1208.50720, 20.03212 ) 
setPlayerNametagColor ( thePlayer, 193, 177, 2 ) 
else 
outputChatBox( "Nie jestes w tym gangu.", getRootElement()) 
end 
end 
addEventHandler("onPlayerLogin",getRootElement(),poli1) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...