-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
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.
-
My server ( SAUR:RPG ) is hosted in OVH, and we have absolutely no complains.
-
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()
-
Resource removed for containing malicious code.
-
Good job! having multi-language will surely bring more players to the mod.
-
That seems like a bug, you should report it in the bug tracker. https://bugs.multitheftauto.com/
-
As far as I know, you can't do it.
-
That whole code makes no sense, is all mixed up.
-
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 )
-
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.
-
There's no native function to do it. You can make a table and a function to do it.
-
First, you shouldn't connect everytime someone tries to login, you should connect only once, and use the handler in the query later.
-
local state = false bindKey ( "F11", "down", function ( ) state = ( not state ) if ( state ) then addEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) else removeEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) end end )
-
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 )
-
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.
-
It means it's a single object, you can't remove just part of an object.
-
The map editor has a remove object feature.
-
Hide it on spawn.
-
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 )
-
createRadarArea createColRectangle onClientColShapeHit onClientColShapeLeave
-
moveObject has rotation arguments.
-
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,