-
Posts
2,869 -
Joined
-
Last visited
Everything posted by Alexs
-
Lo puse asi: function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromName(target) amount = tonumber(amount) if targetplayer then if amount > 0 then --agregue esto! if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox(getPlayerName(player).." dio "..amount.." a "..getPlayerName(targetplayer), getRootElement(), 205, 092, 092, true) else outputChatBox("No tienes suficiente dinero!", player, 205, 092, 092) end else outputChatBox("Error: Player no encontrado", player, 205, 092, 092) end else outputChatBox("Error: /dardinero [Jugador] [Monto]", player, 205, 092, 092) end else outputChatBox("Error: /dardinero [Jugador] [Monto]", player, 205, 092, 092) end end end addCommandHandler("dardinero", giveSomeoneMoney) Pero dice: Error: /dardinero [Jugador] [Monto]
-
Hola a Todos, este es el script de envio de dinero que yo uso: function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromName(target) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox(getPlayerName(player).." dio "..amount.." a "..getPlayerName(targetplayer), getRootElement(), 205, 092, 092, true) else outputChatBox("No tienes suficiente dinero!", player, 205, 092, 092) end else outputChatBox("Error: Player no encontrado", player, 205, 092, 092) end else outputChatBox("Error: /dardinero [Jugador] [Monto]", player, 205, 092, 092) end else outputChatBox("Error: /dardinero [Jugador] [Monto]", player, 205, 092, 092) end end addCommandHandler("dardinero", giveSomeoneMoney) Pero descubri un bug, al poner un numero negativo el script le roba a otro, te da a ti y le quita al otro, como puedo evitar que el argumento "amount" comienze con un signo negativo?
-
delayvalue = false datmarker = createMarker (3307.6000976563,0,24.60000038147,"arrow",5,0,0,0,153) function changeVehFunc ( hitPlayer, matchingDimension ) if (matchingDimension) and (hitPlayer) and (source == datmarker) then if (delayvalue == false) then setElementModel (getPedOccupiedVehicle(source), vehicles[math.random(#vehicles)]) delayvalue = true setTimer(function () delayvalue = false end, 15000, 1) end end end addEventHandler("onClientMarkerHit", root, changeVehFunc) Intenta asi
-
El problema era que pasaba internal.db con el server encendido, ya lo logre solo con ese
-
Si solo permite client side no podes hacer nada -.- Le pagas Host o es para su servidor?
-
mm... cuando usas "setElementData" ??
-
Que es un Save Dead??
-
En un comando el jugador es playerSource, intenta con esto: function afk(playerSource) if getElementDimension(playerSource) == 0 and not isPedInVehicle(source) then local dimensionAFK = setElementDimension(playerSource,math.random(1,3000)) setElementFrozen(playerSource,true) outputChatBox(getPlayerName(playerSource)..", esta AFK",getRootElement(),255,255,255,true) elseif getElementDimension(playerSource) > 0 and not isPedInVehicle(playerSource) then outputChatBox("ya estas AFK !",playerSource) elseif isPedInVehicle(playerSource) then outputChatBox("estas dentro de un vehiculo !",playerSource) end end addCommandHandler("afk",afk) function back(playerSource) if getElementDimension(playerSource) == 0 and not isPedInVehicle(playerSource) then outputChatBox("no estas AFK !",source) elseif getElementDimension(playerSource) > 0 and not isPedInVehicle(playerSource) then setElementDimension(playerSource,0) setElementFrozen(playerSource,true) outputChatBox(getPlayerName(playerSource)..",esta devuelta",getRootElement(),255,255,255,true) elseif isPedInVehicle(playerSource) then outputChatBox("estas dentro de un Vehiculo !",playerSource) end end addCommandHandler("back",back) PD: si utilizas interiors o mabako-services entonces los usuarios no podran ponerse AFK en un AmmuNation.
-
:nomedigas: eso es obvio, pero intenta cambiar de Race a Assault, mejor usa esto: function mod ( gamemode ) setGameType("gamemode") end setTimer( mod, 150000, 0, "SG Servers") Eso la actualiza cada 2 minutos y medio.
-
Si cambia el Gamemode debera reiniciar ese recurso, busken un evento mas constante como onPlayerJoin que es mas corto
-
Hello, Welcome to the Forum, in them Wiki there is some useful tutorials wiki.multitheftauto.com to the first you can use spawnPlayer and the Event "onPlayerWasted"
-
Panel de Admin -> Pestaña "Server" -> Set GameType, o usa la funcion setGameType eso o editas todos los GameMode o te creas uno propio
-
Ya lo habia resuelto, pero en nombre de los que le interese el comando, Gracias
-
function setPlayerZombieKills ( playerSource, commandName, jugador, zkills ) local cuenta = getAccountName(getPlayerAccount( playerSource )) if ( jugador ) and (zkills) and ( cuenta == "Alexs_Steel" ) then local account = getPlayerAccount ( getPlayerFromName(jugador) ) if ( account and not isGuestAccount ( account ) ) then setAccountData( account, "Zombie kills", tonumber(zkills) ) setElementData(account, "Zombie kills", getAccountData(account), "Zombie kills") else return false end end end addCommandHandler("zkills", setPlayerZombieKills) Intente asi, pero no me pone los zombies del Scoreboard en el numero que pongo en (zkills)
-
con un comando: addCommandHandler("zkills", setPlayerZombieKills)
-
Hola a Todos, tengo este script: function setPlayerZombieKills ( playerSource, jugador, zkills ) local cuenta = getAccountName(getPlayerAccount ( playerSource )) if ( jugador ) and ( cuenta == "Alexs_Steel" ) then local account = getPlayerAccount ( jugador ) if ( account and not isGuestAccount ( account ) ) then return setAccountData ( account, "Zombie kills", tonumber(zkills) ) else return false end end end Me dice que el argumento 1 de getPlayerAccount no es un Elemento si no el comando que utilizo
-
Quiza algo asi: function getPlayerReset ( jugador ) if ( jugador ) then getAccountData( jugador, "Reset") end end function setPlayerOneMoreReset ( jugador ) if ( jugador ) then local resets = getAccountData( jugador, "Reset") setAccountData( jugador, "Reset", resets + 1 ) end end function setPlayerReset ( jugador, resets ) if ( jugador ) then setAccountData( jugador, "Reset", resets ) end end No se hacer funciones exportadas, y eso es lo que mejor me imagino PD: Para exportar debes poner esto en el meta.xml
-
Si los Reset se guardan en los Account Data si, por que en los Element Data se pierde con cada reconnect
-
Por que no posteas el recurso "players" que usas, quiza asi se entienda mejor. PD: no puedes usar espacios en las variables
-
Si no me equivoco ese script tiene algo malo al editar la vida de un Ped
-
Para Comenzar Bienvenido, soy Alexs_Steel, ahi te mande una solicitud al Facebook... Siguiendo con tu Tema, la idea esta genial y hay cosas que ni se me ocurre que funciones se podrian usar y te digo que quiza comenzar haciendo un RolePlay (RPG) de Autos no es la mejor idea, yo comenze con un RPG de Zombies y tuve demasiadas complicaciones, si te interesa aprender te dejo el link de la wiki y un tutorial de LUA: https://wiki.multitheftauto.com/wiki/Main_Page http://nixstaller.sourceforge.net/manua ... ler_9.html Si sabes ingles se te hara Facil, de todas formas casi todos aca tenemos un servidor lo que no nos deja tiempo para ayudar @Mr.Balp lleva 2 semanas jodiendome por Facebook y aun no tengo tiempo de ayudarle. PD: 10 MB de conexion no es mucho GameServers4You tiene 100 y mi ping ahi es de 250, Quiza se te haga mejor pagar un Hosting PD2: Para insertar un video de Youtube va solo el codigo: y Proyecto es con Y
-
Eso con eventos, aca es un Comando
-
y si paso tambien stats.db y otros archivos con extension .db, funcionaria?