Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    about gui

    What do you mean by "guieds"? you are talking about all GUI's? if so, then you should edit each script and add it a check to see if player is logged in.
  2. My server ( SAUR:RPG ) is hosted in OVH, and we have absolutely no complains.
  3. I believe there's a small typo in that page: local vehicle = createVehicle(411, 0, 0, 3) vehicle:setDamageProof(vehicle) -- Here vehicle:setFrozen(vehicle) -- Here vehicle:setHealth(1000) vehicle:setVelocity(0.2, 0.2, 0.2) vehicle:destroy()
  4. Castillo

    1.4 Beta Release

    Good job! having multi-language will surely bring more players to the mod.
  5. That seems like a bug, you should report it in the bug tracker. https://bugs.multitheftauto.com/
  6. As far as I know, you can't do it.
  7. That whole code makes no sense, is all mixed up.
  8. handler = dbConnect ( "mysql", "dbname=DBNAME;host=127.0.0.1", "root", "" ) function LoginPlayer ( playerSource, commandName, _password ) local name = getPlayerName ( playerSource ) -- Escape the strings to avoid SQL-Injection local query = dbQuery ( handler, "SELECT * FROM smf_players WHERE username = ? AND password = ?", name, md5 ( _password ) ) if ( query ) then local result, rows = dbPoll ( query, -1 ) if ( rows == 1 ) then outputChatBox ( "You Succefully Logged In.", playerSource ) else outputChatBox ( "An error has occured when trying to login", playerSource ) end end end addCommandHandler ( "loginn", LoginPlayer )
  9. Castillo

    PEDS

    You binded the key to execute the function that binds the key, I think the typo here is that you should've put "warpit2" in the bindKey.
  10. Puede que la manera con la que cierras el servidor evite que se guarden los datos, ya que no es lo mismo cerrarlo asi nomas que usar CTRL + C en la consola del servidor.
  11. There's no native function to do it. You can make a table and a function to do it.
  12. First, you shouldn't connect everytime someone tries to login, you should connect only once, and use the handler in the query later.
  13. Castillo

    BindKey

    local state = false bindKey ( "F11", "down", function ( ) state = ( not state ) if ( state ) then addEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) else removeEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) end end )
  14. function systemrankup ( dataName ) if ( getElementType ( source ) == 'player' ) then if ( dataName == "Rank" or dataName == "Level" ) then local rank = getElementData ( source, 'Rank' ) local level = getElementData ( source, 'Level' ) outputChatBox ( "* Congrulations, you rank and level has been raised your rank is now ".. tostring ( rank ) .." and your level is ".. tostring ( level ) ..".", source, 0, 255, 167 ) end end end addEventHandler ( "onElementDataChange", getRootElement(), systemrankup )
  15. There are many problems in that script. 1: 'vehicle' is a element, not a number, you must use getElementModel to get it's model. 2: getElementSpeed is not defined anywhere, since this is not a MTA native function, you must define it. 3: At guiProgressBarSetProgress, you forgot to get the current bar progress, in order to increase it.
  16. It means it's a single object, you can't remove just part of an object.
  17. The map editor has a remove object feature.
  18. Castillo

    Solved.

    You can use pregFind
  19. Replace this code: addEventHandler ("onPlayerWasted", root, function () setTimer (spawnPlayer, 3000, 1, source, 213.36328+math.random(1,3), 1867.44336+math.random(1,3), 13.14062, 0, getElementModel (source), 0, 0) setTimer (setCameraTarget, 3250, 1, source, source) end) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) end ) function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end function check () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) setTimer (function () check () end, 4000, 1) end end addEventHandler ("onPlayerSpawn", root, check) With this one: local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) setTimer ( spawnPlayer, 3000, 1, source, 213.36328 + math.random ( 1, 3 ), 1867.44336 + math.random ( 1, 3 ), 13.14062, 0, getElementModel ( source ), 0, 0 ) setTimer ( setCameraTarget, 3250, 1, source, source ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end )
  20. createRadarArea createColRectangle onClientColShapeHit onClientColShapeLeave
  21. moveObject has rotation arguments.
  22. Well, to start with, the events you are using are both server side. Second, you put a parentheses where there should be a comma. addEventHandler( "onPlayerWasted", root ) Correct: addEventHandler( "onPlayerWasted", root,
  23. Castillo

    HELP

    if ( getElementData ( localPlayer,"Your_Data" ) == 10) then
×
×
  • Create New...