Jump to content

Como se hace


Plate

Recommended Posts

Posted

Hola otra ves

Los usuarios del mi server me piden que haga resets (como los del zombie Hell party )

Se puede con el recurso exp_system

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Claro, pero vas a tener que crear tu propio sistema de resets, igual es muy facil usando las funciones de mi recurso.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

esta bien hasta ahora ?

function reset (player, command) 
   setPlayerExp (thePlayer, 0) 
   setPlayerLevel (thePlayer, 0) 
end 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Las funcions son exportadas de mi recurso, asi que tenes que usar:

exports [ "exp_system" ]:function ( ) 

Porque usas "thePlayer" si tu argumento es "player"? estas pensando en lo que haces vos?

P.D: es setPlayerEXP, con mayuscula "EXP".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

buue mas o menos hay lo puse solid esta bien?

exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (player, command) 
 exports [ "exp_system" ]:setPlayerExp (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 0) 
end 
addCommandHandler ("Reset", reset ) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Volve a leer mi post anterior y corregi los errores mencionados.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (player, command) 
 exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 0) 
end 
addCommandHandler ("Reset", reset ) 

Posted

Eso aun tiene fallos.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Volve a leer mi post.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Bueno Funciono (gracias Soren y Solid )

pero no da nada en la columna Reset

hay seria?

exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (thePlayer, command) 
 exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 0) 
end 
addCommandHandler ("Reset", reset ) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
Bueno Funciono (gracias Soren y Solid )

Dices enserio que funciono? No me lo esperaba.

En cuanto a la columna usa un settimer para que cheque

Posted

Lo unico que estas haciendo ahi es reiniciar los datos, no estas aumentando los "resets".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Soren puse el setTimer pero no funciona fijate capas que lo hise mal

exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (thePlayer, command) 
 exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) 
end 
addCommandHandler ("Reset", reset ) 
setTimer(reset,1000,1) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

@Soren: No, el quiere que al usar el comando, aumente el dato: "resets" en el scoreboard.

@Plate: Estas mandando cualquiera, no tiene el menor sentido eso.

Tenes que usar getElementData y setElementData.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Soren puse el setTimer pero no funciona fijate capas que lo hise mal
exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (thePlayer, command) 
 exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) 
end 
addCommandHandler ("Reset", reset ) 
setTimer(reset,1000,1) 

Yo no se bien eso de como maejar el score board

Posted

me parece que me mande terriblemente cualquiera pero bue

exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (thePlayer, command) 
 exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) 
local reset = getAccountData(account,"reset") 
    if not reset then setAccountData(account,"reset",0) end 
    setAccountData(account,"reset",tonumber(reset)+1) 
end 
addCommandHandler ("Reset", reset ) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Estas intentando updatear la cuenta, no el data que aparecera en el scoreboard.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

hay ?

exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (thePlayer, command) 
 exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) 
local account = getPlayerAccount(source) 
    if isGuestAccount(account) then return end 
    local reset = getAccountData(account,"reset") 
    if reset then 
        setElementData(source,"reset",tostring(reset)) 
    else 
        setElementData(source,"reset",0) 
end 
end 
addCommandHandler ("Reset", reset ) 
  

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Le seguis mandando cualquiera.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

no entiendo como se usa u.u

el script va serverside?

exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) 
function reset (thePlayer, command) 
 exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) 
   exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) 
local reset = getElementData("reset") 
    if not reset then setElementData("reset",0) end 
    setElementData("reset",tonumber(reset)+1) 
end 
addCommandHandler ("Reset", reset ) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Aaaaaa...Porque intentas hacer esas cosas?

Aunque el script vaya o no server-side, el tema es que, estas tratando de que Castillo te lo arregle (tirando al azar funciones).

Lee que es una funcion, que devuelve. Que es un argumento, que tipos de argumentos hay. Lee que es una variable, y sus tipos.

Lee sobre las condiciones. No entiendo la desesperacion de querer hacer algo tan avanzado. Hay que ir por pasos...

Si vos pensas que esto solo te va a servir en el MTA, estas en otra. Porque hay miles de usos en la programacion, y por eso se pide mucho por eso.

Igual, pienso que esto no lo leen y que seguramente vas a seguir preguntando lo mismo, creando otros topics, debes de capaz encontrarle la vuelta a cada problema. ;)

WRS( World Racing Server) [server] = 8%

Posted

Me podrias dar un ejemplo SIMPLE de getElementData y de setElementData que no sea el de wiki

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Ok pero primero decime que es una funcion, que puede llegar a devolver. Y por otro lado, que son los argumentos.

Si sabes eso, te doy un ejemplo de elementData.

Porque , que facil es que te de un ejemplo para que luego lo copies y cambies una letrita.

WRS( World Racing Server) [server] = 8%

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...