-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
topTable = { } addEvent ( "returnTable", true ) addEventHandler ( "returnTable", getRootElement(), function ( newTable ) topTable = newTable setTimer(removeEventHandler,5000,1,"onClientRender", getRootElement(), yazdir) end ) local font = dxCreateFont ( "font.ttf" ) local fontsize = 1.7 local x,y = guiGetScreenSize ( ) function yazdir ( ) dxDrawImage( x-340, 20, 320, 200, "bgr.png" ) for index = 1, 5 do local top = topTable [ index ] dxDrawText ( tostring ( index ) .." - ".. top.name .." - ".. tostring ( top.data ), x-320, ( 60 * index ), 360, 40, tocolor ( 255, 140 ,0 ), fontsize, font ) end end addEventHandler ( "onClientRender", getRootElement(), yazdir )
-
The only way is editing the script if I'm right, though, I'm not a race user, so I may be wrong.
-
El evento: "onPlayerWeaponFire" no existe.
-
Por lo que veo, el ejemplo esta incompleto, asi que si, esta mal.
-
No funcionaria con 'huntedPlayer' porque no esta definido en ninguna parte.
-
That's because you are checking if there's a "killer", and that's why it works when you do /kill but not when someone kills you. addEventHandler ( "onPlayerWasted", root, function ( totalAmmo, killer, killerWeapon, bodypart, stealth ) if ( killer ) then local account = getPlayerAccount ( killer ) if ( killer ~= source ) then setAccountData ( account, "totalkillsdeaths.Kills", tonumber ( getAccountData ( account, "totalkillsdeaths.Kills" ) or 0 ) +1 ) setElementData ( killer, "Kills", tonumber ( getAccountData ( account, "totalkillsdeaths.Kills" ) ) ) end end local accountSource = getPlayerAccount ( source ) setAccountData ( accountSource, "totalkillsdeaths.Deaths", tonumber ( getAccountData ( accountSource, "totalkillsdeaths.Deaths" ) or 0 ) +1 ) setElementData ( source, "Deaths", tonumber ( getAccountData ( accountSource, "totalkillsdeaths.Deaths" ) ) ) end )
-
addCommandHandler ( "resetpoints", function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do setElementData ( player, "Points", 0 ) local account = getPlayerAccount ( player ) if isGuestAccount ( account ) then setAccountData ( account, "Points", 0 ) end end end )
-
Is wrong. function topmap( player, command ) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick" ) or getAccountName ( v ), data = getAccountData ( v, map ) or 0 } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) triggerClientEvent ( "returnTable", getRootElement(), tableOrder ) end addEventHandler ( 'onMapStarting', root, topmap)
-
topTable = { } addEvent ( "returnTable", true ) addEventHandler ( "returnTable", getRootElement(), function ( newTable ) topTable = newTable setTimer(removeEventHandler,5000,1,"onClientRender", getRootElement(), yazdir) end ) local font = dxCreateFont ( "font.ttf" ) local fontsize = 1.7 local x,y = guiGetScreenSize ( ) function yazdir ( ) dxDrawImage( x-340, 20, 320, 200, "bgr.png" ) for index, top in ipairs ( topTable ) do dxDrawText ( tostring ( index ) .." - ".. top.name .." - ".. tostring ( top.data ), x-320, 60, 360, 40, tocolor(255,140,0), fontsize, font ) end end addEventHandler ( "onClientRender", getRootElement(), yazdir ) You'll have to make so all the texts are created one after other by editing the "Y" position.
-
Si, seguro es un problema de los interiores.
-
Because you forgot to fill the "sendTo" argument at triggerClientEvent.
-
Yo cree un marker en la posicion: 0, 0, 20, le puse para que enviase un mensaje al chat al tocarlo, fui a la posicion: 0, 0, 0 y no paso nada.
-
Ese es el script que usas? porque la ventana siempre estara visible ya que no la ocultaste.
-
-- client side: topTable = { } addEvent ( "returnTable", true ) addEventHandler ( "returnTable", root, function ( newTable ) topTable = newTable end ) And for the server side you trigger 'returnTable' event with the table.
-
triggerServerEvent spawnPlayer
-
You should make a table client side, and trigger a event from server with the new table, so you can update client side one.
-
Busca en google, hay muchos ejemplos.
-
http://www.lua.org/manual/5.1/manual.ht ... table.sort
