Jump to content

Not Work


1LoL1

Recommended Posts

Why this not work? :(

rootElement = getRootElement() 
function onPlayerSpawnHandler () 
    if(accountName) then 
        if(isObjectInACLGroup("user."..accountName, aclGetGroup("VIP"))) then 
        setPedArmor( source, 100 ) 
end 
  
addEventHandler( "onPlayerSpawn", rootElement, onPlayerSpawnHandler ) 

Link to comment

accountName sint defined, and you didnt end the if statements.

function onPlayerSpawnHandler () 
    local account = getPlayerAccount ( source ); 
    if ( not account or isGuestAccount ( account ) ) then  
        return false; 
    end 
     
    local accountName = getAccountName ( account ); 
    if ( accountName and isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "VIP" ) ) ) then  
        setPedArmor ( source, 100 ); 
    end 
end 
addEventHandler( "onPlayerSpawn", root, onPlayerSpawnHandler ) 

Link to comment
accountName sint defined, and you didnt end the if statements.
function onPlayerSpawnHandler () 
    local account = getPlayerAccount ( source ); 
    if ( not account or isGuestAccount ( account ) ) then  
        return false; 
    end 
     
    local accountName = getAccountName ( account ); 
    if ( accountName and isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "VIP" ) ) ) then  
        setPedArmor ( source, 100 ); 
    end 
end 
addEventHandler( "onPlayerSpawn", root, onPlayerSpawnHandler ) 

Error: ERROR: Loading script failed: test/test.lua:8: unexpected symbol near ")"

Link to comment

try this :

function onPlayerSpawnHandler () 
    local account = getPlayerAccount ( source ) 
         if ( not account or isGuestAccount ( account ) ) then return end 
         if ( isObjectInACLGroup ( "user." .. getAccountName (account) , aclGetGroup ( "VIP" ) ) ) then 
        setPedArmor ( source, 100 ) 
    end 
end 
addEventHandler( "onPlayerSpawn", root, onPlayerSpawnHandler ) 

Link to comment
try this :
function onPlayerSpawnHandler () 
    local account = getPlayerAccount ( source ) 
         if ( not account or isGuestAccount ( account ) ) then return end 
         if ( isObjectInACLGroup ( "user." .. getAccountName (account) , aclGetGroup ( "VIP" ) ) ) then 
        setPedArmor ( source, 100 ) 
    end 
end 
addEventHandler( "onPlayerSpawn", root, onPlayerSpawnHandler ) 

Not work :( and 0 errors.

Link to comment
function onPlayerSoawnHandler(player) 
      local account = getPlayerAccount(player) 
              if (not account or isGuestAccount(account)) then return end 
              if (isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("VIP"))) then 
                  setPlayerArmor(player, 100) 
             end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), onPlayerSpawnHandler) 

Link to comment
function onPlayerSoawnHandler(player) 
      local account = getPlayerAccount(player) 
              if (not account or isGuestAccount(account)) then return end 
              if (isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("VIP"))) then 
                  setPlayerArmor(player, 100) 
             end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), onPlayerSpawnHandler) 

lol the source of this event is the player that just spawned.

Link to comment
function onPlayerSoawnHandler(player) 
      local account = getPlayerAccount(player) 
              if (not account or isGuestAccount(account)) then return end 
              if (isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("VIP"))) then 
                  setPlayerArmor(player, 100) 
             end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), onPlayerSpawnHandler) 

Not work and i dont have Gamemodes.. i have only setgamemode.

Link to comment
function onPlayerSpawnHandler() 
    local account = getPlayerAccount(source) 
    if (not account or isGuestAccount(account)) then return end 
    if (isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("VIP"))) then 
        setPlayerArmor(source, 100) 
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), onPlayerSpawnHandler) 

it works. you need to creates ACL group called VIP

Link to comment

tested and working :wink:

function onPlayerSpawnHandler() 
    local account = getPlayerAccount(source) 
    if (not account or isGuestAccount(account)) then return end 
    if (isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("VIP"))) then 
        setPlayerArmor(source, 100) 
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), onPlayerSpawnHandler) 

Link to comment
tested and working :wink:
function onPlayerSpawnHandler() 
    local account = getPlayerAccount(source) 
    if (not account or isGuestAccount(account)) then return end 
    if (isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("VIP"))) then 
        setPlayerArmor(source, 100) 
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), onPlayerSpawnHandler) 

Thanks. Work :D

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...