Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    dbPoll?

    On your script, you are replacing the values everytime, since you are doing: column = value which means, when it gets the second one, it'll replace the other one.
  2. local vehicles = { [ 447 ] = true, [ 425 ] = true, [ 520 ] = true } local teams = { [ "Staff" ] = true, [ "Armed Forces" ] = true } -- Disabled the seasparrow weapons for player not in staff or military forces team addEventHandler ( "onClientVehicleStartEnter", root, function ( thePlayer, seat ) if ( thePlayer == localPlayer ) then if ( vehicles [ getElementModel ( source ) ] ) then local team = getPlayerTeam ( thePlayer ) if ( team and teams [ getTeamName ( team ) ] ) then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) else toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) end end end end ) -- Enable the weapons again when the player leaves the vehicle addEventHandler ( "onClientVehicleStartExit", root, function ( thePlayer, seat ) if ( thePlayer == localPlayer ) then if ( vehicles [ getElementModel ( source ) ] ) then local team = getPlayerTeam ( thePlayer ) if ( not team or not teams [ getTeamName ( team ) ] ) then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end end end ) Try that.
  3. Castillo

    dbPoll?

    You seem not to understand, with your loop at mysql script, you would also need to loop it at your script to get all the results.
  4. That'll create a single timer variable, he should use a table, and no need to create the function every time.
  5. Castillo

    dbPoll?

    And this is the query? local query = exports.mysql:query("SELECT * FROM characters WHERE account='"..accID.."'") If so, then try this: local query = exports.mysql:query("SELECT * FROM characters WHERE account='"..accID.."'") local result, affected = exports.mysql:poll(query) for _, char in ipairs ( result ) do outputChatBox ( char [ "id" ] ) end
  6. You don't need to use getElementsByType, since givePlayerMoney can be used with "root/getRootElement ( )", like this: givePlayerMoney ( root, 9999 )
  7. Cancel the default message at: onPlayerChat With: cancelEvent Then, you can create your own local /me chat.
  8. You mean, when you enter on that server, the chat appears in the bottom of screen? and if you enter in another, it's back in the top of screen?
  9. Castillo

    dbPoll?

    local resulta = {} for result, row in pairs(result) do for column, value in pairs(row) do resulta[column] = value end end What is that for? "result" already returns a table like this: column: value function poll(resultid) local result, num_affected_rows, errmsg = dbPoll(resultPool[resultid], -1) if ( not result ) then outputDebugString("Error: "..errmsg) return false end return result, num_affected_rows end Try that.
  10. @djaa: You are using "abseil" resource? if so, that's the cause.
  11. He wants the pickups to also work on interiors. function createMoney(player) local x, y, z = getElementPosition(player); local x1, y1, x2, y2; local x1 = (x-2)+(math.random()*4); local y1 = (y-2)+(math.random()*4); local x2 = (x-2)+(math.random()*4); local y2 = (y-2)+(math.random()*4); local moneyAmmount = getPlayerMoney(player); -- it is not fair too get all the player money. local moneyAmmount = math.floor(moneyAmmount/1); takePlayerMoney(player, moneyAmmount); -- We are going to create 3 pickups, zo we are just cut the ammount in half local moneyAmmount = math.floor(moneyAmmount/3); local interior = getElementInterior ( player ) local dimension = getElementDimension ( player ) -- Create the pickups local pickups = { createPickup(x1, y1, z, 3, 1212), createPickup(x2, y2, z, 3, 1212), createPickup(x2, y2, z, 3, 1212) } for _, pickup in ipairs ( pickups ) do setElementData ( pickup, "ammount", moneyAmmount ) setElementInterior ( pickup, interior ) setElementDimension ( pickup, dimension ) end end function moneyPickupHit(player) local money = getElementData(source, "ammount"); if money then givePlayerMoney(player, money); destroyElement(source); end end function playerJustGotDied(ammo, attacker, weapon, bodypart) createMoney(source); end addEventHandler("onPickupUse", getRootElement(), moneyPickupHit); addEventHandler("onPlayerWasted", getRootElement(), playerJustGotDied);
  12. That command doesn't work anymore, use Ctrl + G.
  13. Awesome Remp! just awesome!
  14. No fran, esta en: "race/rankingboard_client.lua".
  15. Crea el vehiculo server side, si no, no podras entrar.
  16. You want someone to translate that to english?
  17. Castillo

    [AYUDA] MySQL

    Se ve que no entendiste como funciona ese recurso, el script ese tiene todo lo de mysql, lo unico que hay que hacer es configurar el servidor mysql. P.D: Usa este mejor, que no requiere mysql: https://community.multitheftauto.com/ind ... ls&id=6208
  18. Castillo

    [AYUDA] MySQL

    Para insertar/crear/cambiar usa dbExec, dbQuery se usa para obtener datos.
  19. Castillo

    [AYUDA] MySQL

    No tenes la module de mysql. P.D: Podrias usar las funciones de mysql integradas. dbConnect dbExec dbQuery dbPoll
  20. Castillo

    [AYUDA] MySQL

    No dijiste que error te da...
  21. You could set the dimension when the player dimension changes.
  22. Labels don't support it by default, but you could search on the forums for the custom function. Though, you'll have to adapt it, since the custom function creates many labels to simulate HEX codes.
  23. Castillo

    Serial is Banned

    You must go to the server forums ( if it has ), this is the MTA forums, we can't do anything about it.
  24. That'll create the labels, yes.
×
×
  • Create New...