Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    top wins

    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 )
  2. Castillo

    Ped

    Your ped is server side, right? because giveWeapon is server side only.
  3. Castillo

    Ped

    Your ped is server side, right? because giveWeapon is server side only.
  4. The only way is editing the script if I'm right, though, I'm not a race user, so I may be wrong.
  5. El evento: "onPlayerWeaponFire" no existe.
  6. Por lo que veo, el ejemplo esta incompleto, asi que si, esta mal.
  7. No funcionaria con 'huntedPlayer' porque no esta definido en ninguna parte.
  8. 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 )
  9. Castillo

    gamespeed

    As I said, do it client side.
  10. Castillo

    gamespeed

    Use: setGameSpeed client side.
  11. 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 )
  12. Castillo

    top wins

    Copy my code again.
  13. Castillo

    top wins

    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)
  14. Castillo

    top wins

    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.
  15. Si, seguro es un problema de los interiores.
  16. Castillo

    top wins

    Because you forgot to fill the "sendTo" argument at triggerClientEvent.
  17. 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.
  18. Ese es el script que usas? porque la ventana siempre estara visible ya que no la ocultaste.
  19. Castillo

    top wins

    -- 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.
  20. triggerServerEvent spawnPlayer
  21. Castillo

    top wins

    You should make a table client side, and trigger a event from server with the new table, so you can update client side one.
  22. Busca en google, hay muchos ejemplos.
  23. http://www.lua.org/manual/5.1/manual.ht ... table.sort
×
×
  • Create New...