Jump to content

Georges1999

Members
  • Posts

    8
  • Joined

  • Last visited

1 Follower

About Georges1999

  • Birthday 29/10/1999

Recent Profile Visitors

375 profile views

Georges1999's Achievements

Newbie

Newbie (4/54)

1

Reputation

  1. IIYAMA thank you for ur explanation. I did understand what u've done. You made a variable and u saved the table that contains a key with it. And u left the real table without touching it. If i am wrong correct me.
  2. Hello guys, i need help with this script i made, it's not working as i expect it to. The thing is that i was adding an adminlogin on the ChatBox, whenever an admin login's a messages appears. But then i made a table so i add a command to all the admins that don't want that message to appear, i haven't mastered table yet, so i came here asking for help,and also Some hints so i can learn from it. Script: invisibleAdmins = {} function adminLoginCommand (player, commandName) if commandName == "invlogin" then if isObjectInACLGroup ("user." ..getAccountName( getPlayerAccount(player) ), aclGetGroup ("Admin"))then outputDebugString("Line 7") invisibleAdmins[getPlayerSerial(player)] = true outputDebugString("Working , true") if invisibleAdmins[getPlayerSerial(player)] then outputChatBox("[COB]System:You are now invisible!", player, 0, 0, 255) else outputChatBox("You are not invisible", player, 255,0,0) end if getPlayerSerial(player) == invisibleAdmins[getPlayerSerial(player)] then outputChatBox("You are already invisible", player, 255,0 ,0) end elseif isObjectInACLGroup ("user." ..getAccountName( getPlayerAccount(player) ), aclGetGroup ("Console"))then invisibleAdmins = invisibleAdmins[getPlayerSerial(player)] outputDebugString("Line 18") outputChatBox("[COB]System:You are now invisible!", player, 0, 0, 255) if getPlayerSerial(player) == invisibleAdmins[getPlayerSerial(player)] then outputChatBox("You are already invisible!", player, 255,0 ,0) end elseif isObjectInACLGroup ("user." ..getAccountName( getPlayerAccount(player) ), aclGetGroup ("SuperModerator"))then outputDebugString("Line 26") invisibleAdmins= invisibleAdmins[getPlayerSerial(player)] outputChatBox("[COB]System:You are now invisible!", player, 0, 0, 255) if getPlayerSerial(player) == invisibleAdmins[getPlayerSerial(player)] then outputChatBox("You are already invisible!", player, 255,0 ,0) end elseif isObjectInACLGroup ("user." ..getAccountName( getPlayerAccount(player) ), aclGetGroup ("Moderator"))then outputDebugString("Line 35") invisibleAdmins = invisibleAdmins[getPlayerSerial(player)] outputChatBox("[COB]System:You are now invisible!", player, 0, 0, 255) if getPlayerSerial(player) == invisibleAdmins[getPlayerSerial(player)] then outputChatBox("You are already invisible!", player, 255,0 ,0) end else outputChatBox("[COB]System: You cannot use this command!",player, 255, 0 ,0) end end end addCommandHandler("invlogin", adminLoginCommand) --{Admin}~> <username> logged in as <accountname> function alogin (_ ,theCurrentAccount) if isObjectInACLGroup ("user." ..getAccountName( theCurrentAccount ), aclGetGroup ("Admin"))then outputDebugString("Admin account.") if getPlayerSerial(source) ~= invisibleAdmins[1] then outputDebugString("Working fine, function 3") outputChatBox("{Dev}~> ".. getPlayerName(source).. " has logged in as ".. getAccountName( theCurrentAccount), root, 0, 255, 0 ,true) end elseif isObjectInACLGroup ("user." ..getAccountName( theCurrentAccount ), aclGetGroup ("Console"))then if getPlayerSerial(source) ~= invisibleAdmins[getPlayerSerial(source)] then outputChatBox("{Admin}~> ".. getPlayerName(source).. " has logged in as ".. getAccountName( theCurrentAccount), root, 255, 0, 0 ,true) end elseif isObjectInACLGroup ("user." ..getAccountName( theCurrentAccount ), aclGetGroup ("SuperModerator"))then if getPlayerSerial(source) ~= invisibleAdmins[getPlayerSerial(source)] then outputChatBox("{SuperModerator}~> ".. getPlayerName(source).. " has logged in as ".. getAccountName( theCurrentAccount), root, 255, 0, 0 ,true) end elseif isObjectInACLGroup ("user." ..getAccountName( theCurrentAccount ), aclGetGroup ("Moderator"))then if getPlayerSerial(source) ~= invisibleAdmins[getPlayerSerial(source)] then outputChatBox("{Mod}~> ".. getPlayerName(source).. " has logged in as ".. getAccountName( theCurrentAccount), root, 0, 0, 255 ,true) end end end addEventHandler("onPlayerLogin",root, alogin) Thanks in advance
  3. Hello, i was trying to create a script and i got stuck somewhere inside it. the script's idea is to allow an admin to change a player's nickname. outputDebugString("line 1 is good") function asetnick1(playerSource, commandName, thePlayer, newname) local pName = getPlayerName (playerSource) local sPName = setPlayerName (playerSource, newname) local accName = getAccountName( getPlayerAccount ( playerSource ) ) if (playerSource) then if isObjectInACLGroup("user." ..accName,aclGetGroup( "Admin" ) ) then if isObjectInACLGroup("user." ..accName,aclGetGroup( "Console" ) ) then outputDebugString("line 9 is working") else outputChatBox("You're not an Admin!",playerSource, 255, 0, 0) end end end end addCommandHandler("changenick", asetnick1) i don't know where i went wrong cause my debugscript wasn't showing any errors/warnings. so any help? i didn't know how to express myself by writing the first two variables into the code.
  4. Yeah this looks way better. Cause i already had a script that creates peds. Thank you. ~Georges
  5. okay, thank you , i'll look into it. ~Georges
  6. i meant functions and event but i couldn't modify my post.
  7. Hello guys,i am new to scripting Lua and i need one thing. I am not asking you guys for a code. but just the keywords. i want the thing that helps to make my idea come true in the server. My idea is that when the player kills a Ped the server rewards him the amount that i set for it. I want to know the keywords that i need to use. Thank you ~Georges
×
×
  • Create New...