-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
Did you realize that the images is repeated?
-
client.lua should be server side and server.lua should be client side.
-
function helloCommand ( playerSource, commandName ) local accPlayer = getPlayerAccount(playerSource) local accName = getAccountName(accPlayer) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Donator" ) ) then local theTriggerer = getPlayerName ( playerSource ) triggerClientEvent ( "onHello", getRootElement() ) outputChatBox ( theTriggerer .. " #ffffffstarted sound #ff8c00Hello Man#ffffff!", getRootElement(), 255, 255, 255, true ) end end
-
Try it: addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "Rankicon",":Class\\Rank\\rank_0.png" ) end ) addEventHandler ( "onPlayerLogin", root, function ( _, acc ) local accName = getAccountName ( acc ) local Level = getAccountData(acc, "LV") local LV = tonumber(string.sub(Level, 4)) if (LV >= 0) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_0.png" ) elseif (LV >= 1) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_1.png" ) elseif (LV >= 2) then setElementData ( source, "Rankicon", ":Class\Rank\\rank_2.png" ) elseif (LV >= 3) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_3.png" ) elseif (LV >= 4) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_4.png" ) elseif (LV >= 5) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_5.png" ) elseif (LV >= 6) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_6.png" ) elseif (LV >= 7) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_7.png" ) elseif (LV >= 8 ) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_8.png" ) elseif (LV >= 9) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_9.png" ) elseif (LV >= 10) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_10.png" ) elseif (LV >= 11) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_11.png" ) elseif (LV >= 12) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_12.png" ) elseif (LV >= 13) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_13.png" ) elseif (LV >= 14) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_14.png" ) elseif (LV >= 15) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_15.png" ) elseif (LV >= 16) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_16.png" ) elseif (LV >= 17) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_17.png" ) elseif (LV >= 18) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_18.png" ) elseif (LV >= 19) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_19.png" ) elseif (LV >= 20) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_20.png" ) elseif (LV >= 21) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_21.png" ) elseif (LV >= 22) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_22.png" ) elseif (LV >= 23) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_23.png" ) elseif (LV >= 24) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_23.png" ) elseif (LV >= 25) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_23.png" ) elseif (LV >= 26) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_24.png" ) elseif (LV >= 27) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_24.png" ) elseif (LV >= 28) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_24.png" ) elseif (LV >= 29) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_24.png" ) elseif (LV >= 30) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_24.png" ) elseif (LV >= 31) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_25.png" ) elseif (LV >= 32) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_25.png" ) elseif (LV >= 33) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_25.png" ) elseif (LV >= 34) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_26.png" ) elseif (LV >= 35) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_26.png" ) elseif (LV >= 36) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_26.png" ) elseif (LV >= 37) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_26.png" ) elseif (LV >= 38) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_27.png" ) elseif (LV >= 39) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_27.png" ) elseif (LV >= 40) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_27.png" ) elseif (LV >= 41) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_28.png" ) elseif (LV >= 42) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_28.png" ) elseif (LV >= 43) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_28.png" ) elseif (LV >= 44) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_28.png" ) elseif (LV >= 45) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_28.png" ) elseif (LV >= 46) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_29.png" ) elseif (LV >= 47) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_29.png" ) elseif (LV >= 48) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_29.png" ) elseif (LV >= 49) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_29.png" ) elseif (LV >= 50) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_30.png" ) else setElementData ( source, "Rankicon", ":Class\\Rank\\rank_0.png" ) end end )
-
^True. Y tambien cambia el orden de los argumentos de la funcion de la linea 3 server side: function ( Kicked, reason )
-
Oh, yes. A little error of typing e.e
-
@PaiN^, if you use executeSQLQuery then you can move the file "internal.db", where all the data are stored with the funcion that I said.
-
https://nightly.multitheftauto.com/?mtasa-1.3.4-rc-latest
-
function load() local kills = getAccountData(getPlayerAccount(source),"kills") if kills then setElementData(source,"Zombie kills",kills) setPlayerAnnounceValue ( source, "score", kills ) else setElementData(source,"Zombie kills",0) end end addEventHandler("onPlayerLogin",root,load) Try it. I think you cant change the column's name.
-
Seria mas eficiente poniendo en el primer argumento 'root', en vez de gastar mas recursos del server con un loop. O no?
-
How can I now all the exported functions and events of the gamemode "Paradise"? Should I search on every resource or is there any page where indicate the exported funcions and events? Thank you very much.
-
function givePlayerCarLicence () if not ( getElementData( source, "carLicence" ) ) then setElementData( source, "carLicence", "true" ) outputChatBox("**Otro Conductor en las Carreteras! "..getPlayerName(source).." Ha Pasado el Examen de Conducir**", root,155, 155, 0) end end addEvent("givePlayerCarLicence", true) addEventHandler("givePlayerCarLicence", root, givePlayerCarLicence) --- /licencias function elchat(player) if getElementData( player, "carLicence" ) then outputChatBox ( "-------------------- Licencias --------------------", player, 255, 193, 37 ) outputChatBox ( "Licencia de Autos: #00FF00Si", player, 255, 193, 37, true ) else outputChatBox ( "-------------------- Licencias --------------------", player, 255, 193, 37 ) outputChatBox ( "Licencia de Autos: #00FF00No", player, 255, 193, 37, true ) end end addCommandHandler( "licencias", elchat) -- function onPlayerQuit (acc) local playeraccount if eventName == "onPlayerQuit" then playeraccount = getPlayerAccount ( source ) elseif eventName == "onPlayerLogout" then playeraccount = acc end if not isGuestAccount(playeraccount) then local lic = getElementData(source,"carLicence") if lic then setAccountData ( playeraccount, "carLicence", "true" ) end end end function onPlayerLogin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local lic = getAccountData(source,"carLicence") if tostring(lic) == 'true' then setElementData ( source, "carLicence", lic ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogout", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
-
You can get more information here: http://www.w3schools.com/sql/sql_where.asp
-
Does it really work? Yes, I tested it. Very good work Sarrum .
-
Simplemente haces un timer con setTimer, asi: function getRandomPlayer() return getElementsByType("player")[math.random(#getElementsByType("player"))] end -- getRandomPlayer es solo server side pero ahi te hize una funcion para lo tengas client. local elRandm = getRandomPlayer () nck = getPlayerName ( elRandm ) pings = getPlayerMoney ( elRandm ) tem = getPlayerTeam ( elRandm ) tema = getTeamName ( tem ) ventana = guiCreateWindow(462, 91, 314, 465, "Gridtest", false) guiWindowSetSizable(ventana, false) gridlista = guiCreateGridList(9, 22, 295, 433, false, ventana) guiGridListAddColumn(gridlista, "Jugadores", 0.3) guiGridListAddColumn(gridlista, "Dinero", 0.3) guiGridListAddColumn(gridlista, "Equipo", 0.3) for i = 1, 28 do guiGridListAddRow(gridlista) end guiGridListSetItemText(gridlista, 0, 1, "-"..nck, false, false) guiGridListSetItemText(gridlista, 0, 2, "-"..pings, false, false) guiGridListSetItemText(gridlista, 0, 3, "-"..tema, false, false) guiGridListSetItemText(gridlista, 1, 1, "-", false, false) guiGridListSetItemText(gridlista, 1, 2, "-", false, false) guiGridListSetItemText(gridlista, 1, 3, "-", false, false) guiGridListSetItemText(gridlista, 2, 1, "-", false, false) guiGridListSetItemText(gridlista, 2, 2, "-", false, false) guiGridListSetItemText(gridlista, 2, 3, "-", false, false) guiGridListSetItemText(gridlista, 3, 1, "-", false, false) guiGridListSetItemText(gridlista, 3, 2, "-", false, false) guiGridListSetItemText(gridlista, 3, 3, "-", false, false) guiGridListSetItemText(gridlista, 4, 1, "-", false, false) guiGridListSetItemText(gridlista, 4, 2, "-", false, false) guiGridListSetItemText(gridlista, 4, 3, "-", false, false) guiGridListSetItemText(gridlista, 5, 1, "-", false, false) guiGridListSetItemText(gridlista, 5, 2, "-", false, false) guiGridListSetItemText(gridlista, 5, 3, "-", false, false) guiGridListSetItemText(gridlista, 6, 1, "-", false, false) guiGridListSetItemText(gridlista, 6, 2, "-", false, false) guiGridListSetItemText(gridlista, 6, 3, "-", false, false) guiGridListSetItemText(gridlista, 7, 1, "-", false, false) guiGridListSetItemText(gridlista, 7, 2, "-", false, false) guiGridListSetItemText(gridlista, 7, 3, "-", false, false) guiGridListSetItemText(gridlista, 8, 1, "-", false, false) guiGridListSetItemText(gridlista, 8, 2, "-", false, false) guiGridListSetItemText(gridlista, 8, 3, "-", false, false) guiGridListSetItemText(gridlista, 9, 1, "-", false, false) guiGridListSetItemText(gridlista, 9, 2, "-", false, false) guiGridListSetItemText(gridlista, 9, 3, "-", false, false) guiGridListSetItemText(gridlista, 10, 1, "-", false, false) guiGridListSetItemText(gridlista, 10, 2, "-", false, false) guiGridListSetItemText(gridlista, 10, 3, "-", false, false) guiGridListSetItemText(gridlista, 11, 1, "-", false, false) guiGridListSetItemText(gridlista, 11, 2, "-", false, false) guiGridListSetItemText(gridlista, 11, 3, "-", false, false) guiGridListSetItemText(gridlista, 12, 1, "-", false, false) guiGridListSetItemText(gridlista, 12, 2, "-", false, false) guiGridListSetItemText(gridlista, 12, 3, "-", false, false) guiGridListSetItemText(gridlista, 13, 1, "-", false, false) guiGridListSetItemText(gridlista, 13, 2, "-", false, false) guiGridListSetItemText(gridlista, 13, 3, "-", false, false) guiGridListSetItemText(gridlista, 14, 1, "-", false, false) guiGridListSetItemText(gridlista, 14, 2, "-", false, false) guiGridListSetItemText(gridlista, 14, 3, "-", false, false) guiGridListSetItemText(gridlista, 15, 1, "-", false, false) guiGridListSetItemText(gridlista, 15, 2, "-", false, false) guiGridListSetItemText(gridlista, 15, 3, "-", false, false) guiGridListSetItemText(gridlista, 16, 1, "-", false, false) guiGridListSetItemText(gridlista, 16, 2, "-", false, false) guiGridListSetItemText(gridlista, 16, 3, "-", false, false) guiGridListSetItemText(gridlista, 17, 1, "-", false, false) guiGridListSetItemText(gridlista, 17, 2, "-", false, false) guiGridListSetItemText(gridlista, 17, 3, "-", false, false) guiGridListSetItemText(gridlista, 18, 1, "-", false, false) guiGridListSetItemText(gridlista, 18, 2, "-", false, false) guiGridListSetItemText(gridlista, 18, 3, "-", false, false) guiGridListSetItemText(gridlista, 19, 1, "-", false, false) guiGridListSetItemText(gridlista, 19, 2, "-", false, false) guiGridListSetItemText(gridlista, 19, 3, "-", false, false) guiGridListSetItemText(gridlista, 20, 1, "-", false, false) guiGridListSetItemText(gridlista, 20, 2, "-", false, false) guiGridListSetItemText(gridlista, 20, 3, "-", false, false) guiGridListSetItemText(gridlista, 21, 1, "-", false, false) guiGridListSetItemText(gridlista, 21, 2, "-", false, false) guiGridListSetItemText(gridlista, 21, 3, "-", false, false) guiGridListSetItemText(gridlista, 22, 1, "-", false, false) guiGridListSetItemText(gridlista, 22, 2, "-", false, false) guiGridListSetItemText(gridlista, 22, 3, "-", false, false) guiGridListSetItemText(gridlista, 23, 1, "-", false, false) guiGridListSetItemText(gridlista, 23, 2, "-", false, false) guiGridListSetItemText(gridlista, 23, 3, "-", false, false) guiGridListSetItemText(gridlista, 24, 1, "-", false, false) guiGridListSetItemText(gridlista, 24, 2, "-", false, false) guiGridListSetItemText(gridlista, 24, 3, "-", false, false) guiGridListSetItemText(gridlista, 25, 1, "-", false, false) guiGridListSetItemText(gridlista, 25, 2, "-", false, false) guiGridListSetItemText(gridlista, 25, 3, "-", false, false) guiGridListSetItemText(gridlista, 26, 1, "-", false, false) guiGridListSetItemText(gridlista, 26, 2, "-", false, false) guiGridListSetItemText(gridlista, 26, 3, "-", false, false) guiGridListSetItemText(gridlista, 27, 1, "-", false, false) guiGridListSetItemText(gridlista, 27, 2, "-", false, false) guiGridListSetItemText(gridlista, 27, 3, "-", false, false) bindKey ("F3", "down", function () if guiGetVisible(ventana) == false then guiSetVisible(ventana, true) showCursor ( true ) else guiSetVisible(ventana,false) showCursor ( false ) end end) setTimer(function() nck = getPlayerName ( elRandm ) pings = getPlayerMoney ( elRandm ) tem = getPlayerTeam ( elRandm ) tema = getTeamName ( tem ) guiGridListSetItemText(gridlista, 0, 1, "-"..nck, false, false) guiGridListSetItemText(gridlista, 0, 2, "-"..pings, false, false) guiGridListSetItemText(gridlista, 0, 3, "-"..tema, false, false) end, 1000, 0) -- 1000 son milisegundos , 0 son las veces que se repetira la funcion, en este caso 0 = infinito
-
OffTopic:Nadie es estupido. Si no te responden, espera.Tambien, tienes el subforo scripting del ingles que te responden mas rapido, pero obviamente debes escribir en ingles. OnTopic: Debes hacer un table usando el jugador como index. Asi: vehicleMarker = createMarker(-1558.1606445313, -415.12377929688, 5, 'cylinder', 2.0, 255, 255, 0, 150 ) local vehicle = {} -- Esta es la tabla function vehicleMarkerHit( hitElement, matchingDimension ) playerTeam = getPlayerTeam ( hitElement ) Clann = getTeamFromName ( "Piloto" ) if ( playerTeam ) == Clann then if getElementType( hitElement ) == "player" and not isPedInVehicle(hitElement) then if isElement(vehicle[hitElement]) then destroyElement(vehicle[hitElement]) end vehicle[hitElement] = createVehicle(583, -1550.4964599609, -409.93197631836, 5.8120708465576) -- El index es lo que esta entre corchetes warpPedIntoVehicle(hitElement, vehicle) elseif getElementType( hitElement ) == "vehicle" then end end end addEventHandler( "onMarkerHit", vehicleMarker, vehicleMarkerHit )
-
Remplaza el script que esta en "MTA San Andreas 1.3\server\mods\deathmatch\resources\[gamemodes]\[play]\play" archivo broth.lua por este(No testeado): local spawnpoint addEventHandler("onResourceStart", resourceRoot, function() spawnpoint = getRandomSpawnPoint() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player, 0) end end ) function spawn(player, dim) if not isElement(player) then return end if get("spawnreset") == "onSpawn" then spawnpoint = getRandomSpawnPoint() end exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) repeat until setElementModel(player,math.random(312)) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) setElementDimension(player, dim) end function getRandomSpawnPoint () local spawnpoints = getElementsByType("spawnpoint") return spawnpoints[math.random(1,#spawnpoints)] end addEventHandler("onPlayerJoin", root, function() spawn(source, 0) end ) addEventHandler("onPlayerQuit",root, function () if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then spawnpoint = getRandomSpawnPoint() end end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source, getElementDimension(source)) end )
-
Estas usando el gamemode 'play'? Si no es asi, chequea todos tus scripts porque para revivir se debe hacer un script. Si no hay script, el jugador no revivira.
-
(Ayuda) Problema a la hora de cargar un servidor
Sasu replied to Aeris's topic in Ayuda relacionada al cliente/servidor
Comprueba que los puertos esten abiertos. Ejecuta el comando 'openports' sin comillas, eso te dira cuales estan abiertas o cerradas. -
Where is 'sourcePlayer' defined? @Solidsnake14, you forgot a comma on line 10.
-
Client: function Dgun(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if weapon == 24 and hitElement and dgunStatus then if getElementType(hitElement) == "vehicle" then triggerServerEvent("onRequestVehicleDestroy", localPlayer, hitElement) end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), Dgun ) addCommandHandler("dgun", function() dgunStatus = not dgunStatus outputChatBox("Server: D-gun "..(dgunStatus and "On" or "Off").."!", 0, 255, 0, true) end) Server: addEvent("onRequestVehicleDestroy", true) addEventHandler("onRequestVehicleDestroy", root, function(v) if v and isElement(v) then destroyElement(v) outputChatBox("Server: Destroyed!!", source, 0, 255, 0, true) end end)
-
Puedes mostrar en donde defines 'value'?
-
And if the index doesnt exist? To improve: for index = 1, 10 do local data = myTable [ index ] if ( not data ) then break end end