Jump to content

Wei

Members
  • Posts

    814
  • Joined

  • Last visited

Everything posted by Wei

  1. function isplayeradmin() local players = getElementsByType ( "player" ) for _,v in ipairs(players) do local isadmin = ( hasObjectPermissionTo ( v, "command.aexec", true ) ) setElementData(v, "admin", isadmin) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), isplayeradmin)
  2. Wei

    math what?

    hi. how can I make that it will put 900 instead of 900.32123. This is for getElementHealth
  3. bool spawnPlayer ( player thePlayer, float x, float y, float z, [ int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil ] ) Look what is the last argument...
  4. Wei

    Weapon save

    You're welcome.
  5. Wei

    Weapon save

    local tempData = { } addEventHandler ( "onPlayerWasted", getRootElement(), function ( ) tempData [ source ] = { weapons = getWeaponsTable ( source ), skin = getElementModel ( source ) } end ) addEventHandler ( "onPlayerSpawn", getRootElement(), function ( ) if ( tempData [ source ] ) then setElementModel ( source, tempData [ source ].skin ) for weapon, ammo in pairs ( tempData [ source ].weapons ) do giveWeapon ( source, weapon, ammo, true ) end end end ) function getWeaponsTable ( thePlayer ) local weapons = { } local hasAnyWeapon = false for slot = 0, 12 do local weapon = getPedWeapon ( thePlayer, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( thePlayer, slot ) if ( ammo > 0 ) then weapons [ weapon ] = ammo hasAnyWeapon = true end end end if ( hasAnyWeapon ) then return weapons end end Here you have
  6. addEvent ( "repair1", true ) addEventHandler ( "repair1", getRootElement(), repair1 )
  7. Wei

    Weapon save

    You could search at forum before asking Sample... https://forum.multitheftauto.com/viewtopic.php?f=91&t=41780&p=424047&hilit=getPedTotalAmmo+setAccountData#p424047
  8. Wei

    Error

    addEvent('onDkhl', true) function dkhl() spawnPlayer(source, 548.66711425781, -1427.5430908203, 16.1328125) outputChatBox('You have been warped to dkhl area',source,0,255,0) end addEventHandler('onDkhl', root, dkhl) function dkhl() if ( source == GUIEditor_Button[12]) then triggerServerEvent('onDkhl', localPlayer) end end addEventHandler('onClientGUIClick', guiRoot, dkhl, true) Tested and it works
  9. Wei

    Error

    server side addEvent('onDkhl', true) function dkhl() setElementPosition(source, 548.66711425781, -14 27.5430908203, 16.1328125) outputChatBox('You have been warped to dkhl area',source,0,255,0) end addEventHandler("onDkhl", getRootElement(), dkhl ) client side function dkhl() if ( source == GUIEditor_Button[12] ) then triggerServerEvent('onDkhl', localPlayer) end end addEventHandler('onClientGUIClick', guiRoot, dkhl)
  10. Wei

    how

    Thank you !
  11. Wei

    how

    And how can I add Text ?
  12. Wei

    how

    How can I make this working ? local thePickups = { "1236.14709, -1326.85632, 13.76983" } function createPickups() for i, n in pairs(thePickups) do infopointpickup = createPickup(n, 3, 1239, 0.1) end end addEventHandler("onResourceStart", getRootElement(), createPickups) And how can I add the text to them. Like Pickup 1 has position 0,0,0 and when i hit pickup 1 it outputs Pickup 1 text
  13. All you have do is that you canged color and name...
  14. Wei

    sql

    something like that: exports.sql:query_insertid( "INSERT INTO doingJob (Player, State,) VALUES (" .. table.concat( { theName, state } ) .. ")" )
  15. Wei

    sql

    what about sql resource ? Is there any wiki for it ?
  16. Wei

    RP stats

    showPlayerHudComponent
  17. Wei

    sql

    I'm learning sql and I need some help. Can somebuddy show me an example of save system ?
  18. No. Router ports and delete hamachi...
  19. Wei

    MTA Paradise.

    Is it in acl ?
  20. Wei

    MTA Paradise.

    local server = get( "server" ) or "localhost" -- server local user = get( "user" ) or "ElMota" -- username local password = get( "password" ) or "*******" -- password local db = get( "database" ) or "elmota" -- database local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil
  21. Wei

    MTA Paradise.

    if you've made the database then you set the name of it. Lol
×
×
  • Create New...