1LoL1 Posted April 17, 2015 Posted April 17, 2015 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 )
xXMADEXx Posted April 18, 2015 Posted April 18, 2015 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 ) The Ultimate Lua Tutorial! | MTA PHP SDK
1LoL1 Posted April 18, 2015 Author Posted April 18, 2015 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 ")"
Walid Posted April 18, 2015 Posted April 18, 2015 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 ) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
1LoL1 Posted April 18, 2015 Author Posted April 18, 2015 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.
Dimos7 Posted April 18, 2015 Posted April 18, 2015 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)
Walid Posted April 18, 2015 Posted April 18, 2015 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. Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Dimos7 Posted April 18, 2015 Posted April 18, 2015 he can remove the player and place the source its the same think
Walid Posted April 18, 2015 Posted April 18, 2015 he can remove the player and place the source its the same think no it's not Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
1LoL1 Posted April 18, 2015 Author Posted April 18, 2015 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.
Enargy, Posted April 18, 2015 Posted April 18, 2015 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 - Inactivo.
#RooTs Posted April 19, 2015 Posted April 19, 2015 tested and working 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)
1LoL1 Posted April 19, 2015 Author Posted April 19, 2015 tested and working 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now