Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Entonces ni idea, tenes algo mal, aca funciona perfectamente.
  2. Yo lo probe y me funciona perfectamente, una de dos: No estas guardando el archivo o estas editando el equivocado.
  3. The function: takeWeapon is server side, and getLocalPlayer() is client side only. P.S: That's not the right way to use bindKey in a server side.
  4. local teams = { {createTeam("Aliens"), {13, 22, 23}, {0, 0, 5}, {[31] = 500, [24] = 200}}, -- 0, 0, 0 = la posicion. {createTeam("Humans"), {1, 2, 3}, {0, 0, 5}, {[30] = 700, [25] = 300}}, } addEventHandler("onPlayerLogin",root, function () local team, skins, position, weapons = unpack(teams[math.random(#teams)]) if (team and skins and position and weapons) then setPlayerTeam(source, team) setElementModel(source, skins[math.random(#skins)]) spawnPlayer(source, unpack(position)) for weapon, ammo in pairs(weapons) do giveWeapon(source, weapon, ammo, true) end end end)
  5. Try this: addEventHandler("onPlayerCommand", root, function (command) if (command == "gun") then cancelEvent() end end)
  6. Castillo

    Fallo

    function creatingTables() exports.scoreboard:addScoreboardColumn("Cash") executeSQLCreateTable("playerData", "serial STRING, Cash INT, DMAttempts INT, DDAttempts INT") outputChatBox("Cash System by KHD started.") for index, player in ipairs(getElementsByType("player")) do addAccountIfNotExists(player) end end addEventHandler("onResourceStart", resourceRoot, creatingTables) function addAccountIfNotExists(player) local serial = getPlayerSerial(player) local CheckPlayer = executeSQLSelect ( "playerData", "*", "serial = '" .. serial .. "'" ) if ( type( CheckPlayer ) == "table" and #CheckPlayer == 0 ) or not CheckPlayer then executeSQLInsert ( "playerData", "'"..serial.."','0','0','0'" ) else local Cash = tonumber(CheckPlayer [1]["Cash"]) setElementData(source,"Cash", Cash) setElementData(source,"data.money",Cash,true) end end addEventHandler("onPlayerJoin",root,function () addAccountIfNotExists(source) end) function DestructionMoney(mapInfo,mapOptions,gameOptions) info = mapInfo.modename if mapInfo.modename == "Destruction derby" then for k,v in ipairs(getElementsByType("player")) do local serial = getPlayerSerial(v) local DDAttempts = executeSQLSelect ( "playerData", "DDAttempts","serial = '" .. serial .. "'") local DDAttempts = tonumber(DDAttempts[1]["DDAttempts"]) + 1 executeSQLUpdate ( "playerData", "DDAttempts = '"..DDAttempts.."'","serial = '" .. serial .. "'") setElementData(v,"data.DDAttempts",DDAttempts,true) end end end addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), DestructionMoney) function DestructionMoney2(thePlayer) local playername = getPlayerName(thePlayer) local serial = getPlayerSerial(thePlayer) local Cash = executeSQLSelect ( "playerData", "Cash","serial = '" .. serial .. "'") outputChatBox("*Wins: "..playername.." took $"..get('MoneyForDD').." for winning the map!",getRootElement(),255,255,0) local Cash = tonumber(Cash[1]["Cash"]) + get('MoneyForDD') setElementData(thePlayer ,"Cash", Cash) setElementData(thePlayer ,"data.money",Cash,true) setElementData(thePlayer ,"data.playername",playername,true) executeSQLUpdate ( "playerData", "Cash = '"..Cash.."'","serial = '" .. serial .. "'") end function hunterBonus(pickupID, pickupType, vehicleModel) if (info == "Destruction derby" and pickupType == "vehiclechange" and vehicleModel == 425) then local serial = getPlayerSerial(source) local Cash = executeSQLSelect ( "playerData", "Cash","serial = '" .. serial .. "'") local Cash = tonumber(Cash[1]["Cash"]) + 1000 outputChatBox("*Hunter: "..getPlayerName(source).." gets a $1000 hunter bonus!",source,25,125,225) setElementData(source ,"Cash", Cash) setElementData(source ,"data.money",Cash,true) executeSQLUpdate ( "playerData", "Cash = '"..Cash.."'","serial = '" .. serial .. "'") end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),hunterBonus) addCommandHandler("cash", function (thePlayer) local money = tonumber(getElementData(thePlayer,"data.money")) if (money) then outputChatBox("Your money is $".. tostring(money) .."!",thePlayer,0,255,0) end end) addCommandHandler("flip", function(thePlayer, flip, ammount) local serial = getPlayerSerial(thePlayer) -- El argumento es "thePlayer", no "source". local money = executeSQLSelect ( "playerData", "Cash","serial = '" .. serial .. "'") if tonumber(ammount) > tonumber(getElementData(thePlayer,"data.money")) then outputChatBox("You don't have that kind of money",thePlayer,255,0,0) elseif tonumber(ammount) > 1000 then outputChatBox("You can't flip more than 1000$",thePlayer,255,0,0) end local money = tonumber(getElementData(thePlayer,"data.money")) if tonumber(ammount) <= tonumber(money) and tonumber(ammount) <= 1000 then if math.random (2) == 1 then setElementData(thePlayer, "data.money", money+tonumber(ammount)) outputChatBox("Flip: "..getPlayerName(thePlayer).. " #00ff00flip " ..tonumber(ammount).. " and Wins!!",getRootElement(),0,255,0, true ) else setElementData(thePlayer, "data.money", money-tonumber(ammount)) outputChatBox("Flip: "..getPlayerName(thePlayer).." #ff00ffflip " ..tonumber(ammount).. " and Lose!!",getRootElement(),255,0,0, true ) end end executeSQLUpdate ( "playerData", "Cash = '"..money.."'","serial = '" .. serial .. "'") end)
  7. function giveAllMoney(thePlayer, commandName, money) if (exports.global:isPlayerLeadAdmin(thePlayer)) then if (not money) then outputChatBox("SYNTAX: /" .. commandName .. " [Money]", thePlayer, 255, 194, 14) else local username = getPlayerName(thePlayer) local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) exports.global:sendMessageToAdmins("AdmCmd: " .. getPlayerName(thePlayer) .. " gave all players online " .. money .. " dollars.") outputChatBox("You have given $" .. money .. " to all players ", thePlayer) for index, player in ipairs(getElementsByType("player")) do exports.global:giveMoney( player, tonumber( money ) ) outputChatBox("Admin " .. username .. " has given you $" .. money .. ".", player) end outputChatBox(" " .. tostring(adminTitle) .. " " .. getPlayerName(thePlayer) .. " gave all players online " .. money .. " dollars.", getRootElement(), 255, 0, 51) end end end addCommandHandler("giveallmoney", giveAllMoney, false, false)
  8. Do you mean the pickup of nitro? if so, server's create's their own models, textures.
  9. "race/racevoting_server.lua", search for "redo".
  10. No es de ese script, lo probe y funciona perfectamente.
  11. local teams = { {getTeamFromName("Aliens"), {13, 22, 23}, {0, 0, 5}, {[31] = 500, [24] = 200}}, -- 0, 0, 0 = la posicion. {getTeamFromName("Humans"), {1, 2, 3}, {0, 0, 5}, {[30] = 700, [25] = 300}}, } addEventHandler("onPlayerLogin",root, function () local team, skins, position, weapons = unpack(teams[math.random(#teams)]) if (team and skins and position and weapons) then setPlayerTeam(source, team) setElementModel(source, skins[math.random(#skins)]) spawnPlayer(source, unpack(position)) for weapon, ammo in pairs(weapons) do giveWeapon(source, weapon, ammo, true) end end end)
  12. addEventHandler("onClientResourceStart",resourceRoot, function() Inicio = guiCreateWindow(457,224,552,404,"|eF|ExtremeForce",false) Login = guiCreateButton(9,343,113,39,"Login",false, Inicio) Register = guiCreateButton(141,342,113,39,"Register",false,Inicio) Miembros = guiCreateButton(9,37,114,38,"Memebers",false,Inicio ) Help = guiCreateButton(9,187,113,39,"Help",false,Inicio ) guiSetAlpha(Boton1,0.80) guiSetAlpha(Miemebros,0.80) showCursor ( true ) end ) function openMenu() if (source == Miembros) then if isElement(Menu1) then destroyElement(Menu1) end if isElement(Menu2) then destroyElement(Menu2) end Menu1 = guiCreateMemo(141,29,402,306,"Menu1",false,Miembros) elseif (source == Help) then if isElement(Menu1) then destroyElement(Menu1) end if isElement(Menu2) then destroyElement(Menu2) end Menu2 = guiCreateMemo(141,29,402,306,"Menu2",false,Help) end end addEventHandler("onClientGUIClick",getRootElement(),openMenu)
  13. Benxamix, have you even read the whole post?
  14. Copia el client side de nuevo, arregle un error.
  15. Pekio, podrias explicarnos cual es el problema? aparte de que ese script es un lio.
  16. @pekio: Ese script es SERVER SIDE, si lo pone como client side no va a funcionar. @Soren: El script client side esta mal. -- client side: addEventHandler("onClientResourceStart",resourceRoot, function () local skinTXD = engineLoadTXD ( "skins/13.txd" ) --Alien by iSoRen engineImportTXD ( skinTXD , 13 ) local skinDFF = engineLoadDFF("skins/13.dff", 0 ) engineReplaceModel(skinDFF , 13) local skin2TXD = engineLoadTXD ( "skins/22.txd" ) -- Alien Boss by iSoRen engineImportTXD ( skin2TXD , 22 ) local skinDFF = engineLoadDFF("skins/22.dff", 0 ) engineReplaceModel(skinDFF , 22) local skin2TXD = engineLoadTXD ( "skins/23.txd" ) -- Chewbacka engineImportTXD ( skin2TXD , 23 ) local skin2DFF = engineLoadDFF("skins/23.dff", 0 ) engineReplaceModel(skin2DFF , 23) local skinTXD = engineLoadTXD ( "skins/1.txd" ) --Stormtrooper engineImportTXD ( skinTXD , 1 ) local skinDFF = engineLoadDFF("skins/1.dff", 0 ) engineReplaceModel(skinDFF , 1) local skin2TXD = engineLoadTXD ( "skins/2.txd" ) --Darth Vader engineImportTXD ( skin2TXD , 2 ) local skin2DFF = engineLoadDFF("skins/2.dff", 0 ) engineReplaceModel(skin2DFF , 2) local skin2TXD = engineLoadTXD ( "skins/3.txd" ) -- Red Stormtroper engineImportTXD ( skin2TXD , 3 ) local skinDFF = engineLoadDFF("skins/3.dff", 0 ) engineReplaceModel(skinDFF , 3) end)
  17. Seguro que Imperio se hizo pasar por mi en algun momento . Pero por favor, no me confundas con el .
  18. function setOnFire(attacker, attackerweapon, bodypart, loss) if (getElementData(source,"zombie") and attackerweapon == 6) and (loss > 1) then setPedOnFire(source, true) end end addEventHandler ("onClientPedDamage", getRootElement(), setOnFire)
  19. addEvent( "onVehColorChange",true ) addEvent( "onMapStarting",true ) function setTheCarColors( ) for i, car in ipairs( getElementsByType( "vehicle" ) ) do local theplayer = getVehicleController( car ) if (theplayer and isElement( theplayer )) then local nowteam = getPlayerTeam( theplayer ) local endteam = getTeamFromName( "END#" ) if (nowteam == endteam) then setVehicleColor( car, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) end end end end addEventHandler( "onVehColorChange",root,setTheCarColors ) function timer( ) --Delay it a bit to allow players to warp in their vehicle... setTimer( setTheCarColors,500,0 ) end addEventHandler("onMapStarting",root,timer ) addCommandHandler ( "set_vehicle_color", setTheCarColors )
  20. To create "animated" images you'll need scripting knowledge.
  21. MTA doesn't support GIF images.
  22. I guess he doesn't release it uncompiled to avoid people from using his scripts, and not the game mode.
  23. Maybe because that's a f** mess? local restriction = {} function fck(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFFFck You! #abcdef(type: /fu)", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000You must wait 5 seconds to write this command again.", root, 255, 255, 255, true) end end addCommandHandler("fck", fck) function hateMap(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFFI hate this map! #abcdef(type: /hatemap)", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000You must wait 5 seconds to write this command again.", root, 255, 255, 255, true) end end addCommandHandler("hatemap", hateMap) function loveYou(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFFI love you :-* #abcdef(type: /ilu)", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000You must wait 5 seconds to write this command again.", root, 255, 255, 255, true) end end addCommandHandler("ilu", loveYou)
  24. You didn't add the command handler yet, or that's not the whole script?
×
×
  • Create New...