Jump to content

PacMan

Members
  • Posts

    22
  • Joined

  • Last visited

Posts posted by PacMan

  1. function Radio (command, stationID)
    local result = setRadioChannel ( tonumber( stationID ) )
    if result then -- if we had a valid ID
    outputChatBox ( "Changed your radio station to " .. stationID .. "!" )
    else
    outputChatBox ( "Invalid radio station ID, valid ones are 0-12." )
    end
    end
    addCommandHandler ("setradio", Radio) --How to use: setradio 5
    

    this was unefficent, no need for getting channel if you already have its variable, also string interpolation makes tonumber() automaticly

    In this case string interpolates C++, but not Lua, this must consider.

  2. varez, you propose the wrong decision, when you convert nil in the number of remains nil.

    The error says that you compare the number with nil value, this happens when you do not enter the transfer amount.

    After the announcement of the function add "rrr = tonumber(rrr) or 0".

  3. triggerClientEvent ( "onPlayerReSortMeTableRankMM", g_Root, countPlayersInMM, unpack(tablePlayersInMMnick), unpack(tablePlayersInMMpoints))
    

    In this example, you are call two unpack functions together, the syntax Lua is unacceptable, you first have to pack everything into one table, and then unpack it.

  4. Give and 200 and 10000 ammo, it does not affect.

    Note that if don't called setPedControlState (ped, "aim_weapon", true), then fire is visible, but the bullets did not fly in the direction indicated setPedAimTarget (ped, 5, 5, 3), and in side as he was spawned, ie rotation don't work.

  5. Tell me please how force NPC to shoot?

    I do so:

    setPedAimTarget (ped, 5, 5, 3)

    setPedControlState (ped, "aim_weapon", true)

    setPedControlState (ped, "fire", true)

    Animations fire playing, and shots are not visible.

  6. Better still make a function similar to temporary login with obtaining rights as it is now using /login triggered event onPlayerLogin and leaving onPlayerLogout. When player logout ACL rights should automatically disappear.

    For example:

    playerLogin( player thePlayer, acl theAcl )

    playerLogout( player thePlayer )

  7. With these functions would be much easier, for example, take your "admin" resource. There are commands to administer the server, but to use them need ACL right, could simply get necessary rights and working with any resources.

    You can certainly go the difficult way and write your own system for temporary obtaining of rights, constantly adding and removing user accounts and ACL rights, but agree it is not the best solution.

  8. It would be nice if there were add scripting function for virtual set ACL rights for player at time of current game.

    Something like:

    setPlayerAclGroup (player thePlayer, string groupName, bool access)

    Or:

    loginAclGroup( player thePlayer, string groupName )

    logoutAclGroup( player thePlayer )

    That would be a good alternative use for its own account system.

  9. Today I specifically tested cheats on weapons, if you give weapon to itself that you previously was not, you some time can go with it and then write Network Trobleshoting, while from it is impossible to kill. If you use client-side functions for get weapons/ammo write cheats ammo values, server-side functions write that you have weaponID 0 and writes number of ammo that you gave yourself. If script give to you any weapon, you can safely give yourself any number ammo, this number will be synchronized with the server, you can go with the infinite weapons and all kills.

  10. I can not find nowhere complete information on EDF.

    I am interested in what other child besides may contain the root element , saw a , is there still something like what is unspecified the wiki? Also, I would like to know the complete list of supported attributes for and . Tell me where can read about this?

  11. It is possible to learn from you, really somehow to influence client scripts during their work, from client-side, that is to hack a script and to change all its logic? For example, to change work of any functions in client scripts, or to call client-side functions, for example setPlayerMoney which gives money to the player, or setElementPosition which teleports the player.

×
×
  • Create New...