Jump to content

zneext

Members
  • Posts

    8
  • Joined

  • Last visited

1 Follower

Details

  • Location
    Brazil

Recent Profile Visitors

1,160 profile views

zneext's Achievements

Newbie

Newbie (4/54)

7

Reputation

  1. The with-regex way: function isStringValid ( str ) return not pregFind ( str, "[^a-zA-Z0-9_]" ); end
  2. zneext

    [HELP]

    You're passing text as a number somewhere, When you need to pass a string, Althought if you do want to be able to pass numbers use tostring to convert them to strings and be able to use gsub.
  3. A better implementation to this would be with tables: -- Define ACLs' salary local acl2salary = { -- ["ACL NAME"] = salary, ["PMSP2"] = 2000, ["BOPE2"] = 1000, ["ROTA2"] = 1000, ["NARCOS2"] = 1000 } function giveSalaries () -- Loop throught all the previously defined ACLs for aclName, salary in pairs ( acl2salary ) do -- Loop throught all the ACL's objects for index, objectName in pairs ( aclGroupListObjects ( aclGetGroup ( aclName ) ) ) do -- Check if the object is an account (and if it is, check if the account exists) if ( objectName:find ( "^user." ) and getAccount ( (objectName:gsub ( "^user.", "" )) ) ) then -- Try to get a player from his account name local player = getAccountPlayer ( getAccount ( (objectName:gsub ( "^user.", "" )) ) ) -- Make sure we've found a player if ( player ) then -- Give him the money givePlayerMoney ( player, salary ) outputChatBox ( "SALARY: You received $" .. salary .. "!", player ) end end end end end -- Repeat every 5 seconds infinite times setTimer ( giveSalaries, 5000, 0 ) Untested, but it should work.
  4. https://github.com/multitheftauto/mtasa-blue/pull/63
  5. zneext

    isNil?

    if ( array[4] ~= nil ) then or even if ( array[4] ) then will check if the index 4 exists.
  6. I think he wants to make a dictionary, not a list, If that's the case: playerTable[number][player] = true is the way to go.
  7. You need to specify in which window the button is, Assuming that you defined the button in the main window (wndMain) the code should be the following: guiSetEnabled( getControl( wndMain, "BalasExplosivas" ), false )
  8. As novo said there's not a predefined variable with that value, But you can obtain the "source function" using debug.getinfo: local sourceFunction = debug.getinfo( 1, "f" ).func however the easiest solution is naming the function.
×
×
  • Create New...