Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Doesn't he want a kind of level system? e.g: kill 10 players, level up to rank 1, kill 20, rank 2, and so on.
  2. Bssol, you never check the points, and also, you are setting rank +1 each time you kill.
  3. Yes, it should do, why don't you test it?
  4. 1. You need a MySQL server and XAMPP can do the job, so yes, you need it. 2. You must get the MySQL module by Ryden, here: https://wiki.multitheftauto.com/wiki/Mysql 3. That depends on the MTA paradise, I think is on a resource called "sql" or "mysql". 4. You must add the module like it explains the wiki page. 5. I don't know about that, maybe someone else can answer to that question.
  5. Try something like this: exports.scoreboard:scoreboardAddColumn("Points") exports.scoreboard:scoreboardAddColumn("Rank") ranks = {[1] = {"Beginner lvl 1", 10}, [2] = {"Beginner lvl 2", 15}, [3] = {"Good Player", 25}, [4] = {"Nice Player", 35}, [5] = {"Pro Player", 40}} function addPoints(ammo, attacker, weapon, bodypart) local points = tonumber(getElementData(attacker, "Points")) local rank = getElementData(attacker, "Rank") local killername = getPlayerName(attacker) local targetname = getPlayerName(source) if attacker and attacker ~= source then setElementData(attacker, "Points", tonumber(points) + 1) outputChatBox(killername .. " killed " .. targetname .. " and gained 1 point.", getRootElement(), 255, 255, 0, false) if points >= ranks[rank][2] then setElementData(attacker, "Rank", tonumber(rank) + 1) end end end addEventHandler("onPlayerWasted", getRootElement(), addPoints)
  6. Why you client and server side? you can just use onPlayerWasted server side, the trigger is completely useless.
  7. Dev-Point, why can't you just try to help him? you keep saying that he want's to do something else.
  8. Put the /me command canceler in SERVER SIDE, a different script. the onPlayerChat event is a SERVER ONLY event.
  9. Dev-Point, are you blind or what? top sniper said: "I don't want to use it for a shop .. I want to make a panel for admins .." -- server side: -- client side: outputChatBox(".:Azan Time by ===[TopSniper]===| #FFFF1APress F3 To Open it :.",0,255,0,true) --- Windows --- zWin = guiCreateWindow(200,200,700,700,"Azan",false) qZwin = guiCreateButton(200,400,100,100,"وقت الاذان",false,zWin) function onresourceStart () bindKey ("F3", "down", showWindow) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) -- Bind -- function showWindow () getVisible = guiGetVisible (zWin) if (getVisible == true) then guiSetVisible (zWin, false) showCursor (false) guiSetInputEnabled(false) end if (getVisible == false) then guiSetVisible (zWin, true) showCursor (true) guiSetInputEnabled(true) end end addEventHandler("onClientGUIClick",qZwin, function () triggerServerEvent("freezeAllPlayers",localPlayer) end) addEvent("freezeAllPlayers",true) addEventHandler("freezeAllPlayers",root, function () for index, player in pairs(getElementsByType("player")) do if (player ~= source) then setElementFrozen(player, true) end end outputChatBox(getPlayerName(source) .." has frozen everyone.",getRootElement(),255,0,0) end)
  10. You should read the wiki comment: This article needs checking for the following reason: Hard-coded MTA commands do not work with toggleControl, return false and bad argument. Edit: Maybe this way: -- client side: function disableMap ( ) toggleControl("radar", false) end addEventHandler ( "onClientResourceStart", resourceRoot, disableMap )
  11. You could try using my "exp_system" resource: https://community.multitheftauto.com/index.php?p= ... ls&id=1253 It's a basic experience/level system.
  12. You can't get the player ACL group, but you can make a function that checks if he's in one and then return the group name.
  13. Castillo

    Problems

    Your script is a mess, you are creating like 6 functions to do the same thing, why not just create one?
  14. outputChatBox(" #FFFF00" .. adminRank .. " #00FF00 - On Duty", thePlayer, 255, 194, 14, true)
  15. Castillo

    Problems

    addCommandHandler("saveM", -- save position, where the markers going to go function(player,command,comment) if (command) then comment = tostring(comment) local x,y,z = getElementPosition(player) outputChatBox("What type of marker do you want: Press [ = checkpoint, ] = ring, ; = cylinder, ' = arrow, , = corona.",player,100,0,0) local key = {"[", "]", ";", "'", ","} bindKey(player,key,"down", function(player,key,keystate) if (key == "[") then local Mtype = "checkpoint" outputChatBox("What do you want your marker size to be? (1 -10)",player,100,0,0) unbindKey(player,key) local numbers = {1,2,3,4,5,6,7,8,9,10} bindKey(player,tostring(numbers),"down", function(player,numbers,keystate) if (numbers) then local Msize = tonumber(numbers) local markerID = {x,y,z,Mtype,Msize} triggerEvent("Marker",getRootElement(),markerID,comment) unbindKey(player,numbers) end end) elseif (key == "]") then local Mtype = "ring" outputChatBox("What do you want your marker size to be? (1 -10)",player,100,0,0) unbindKey(player,key) local numbers = {1,2,3,4,5,6,7,8,9,10} bindKey(player,tostring(numbers),"down", function(player,numbers,keystate) if (numbers) then local Msize = tonumber(numbers) local markerID = {x,y,z,Mtype,Msize} triggerEvent("Marker",getRootElement(),markerID,comment) unbindKey(player,numbers) end end) elseif (key == ";") then local Mtype = "cylinder" outputChatBox("What do you want your marker size to be? (1 -10)",player,100,0,0) unbindKey(player,key) local numbers = {1,2,3,4,5,6,7,8,9,10} bindKey(player,tostring(numbers),"down", function(player,numbers,keystate) if (numbers) then local Msize = tonumber(numbers) local markerID = {x,y,z,Mtype,Msize} triggerEvent("Marker",getRootElement(),markerID,comment) unbindKey(player,numbers) end end) elseif (key == "'") then local Mtype = "arrow" outputChatBox("What do you want your marker size to be? (1 -10)",player,100,0,0) unbindKey(player,key) local numbers = {1,2,3,4,5,6,7,8,9,10} bindKey(player,tostring(numbers),"down", function(player,numbers,keystate) if (numbers) then local Msize = tonumber(numbers) local markerID = {x,y,z,Mtype,Msize} triggerEvent("Marker",getRootElement(),markerID,comment) unbindKey(player,numbers) end end) elseif (key == ",") then local Mtype = "corona" outputChatBox("What do you want your marker size to be? (1 -10)",player,100,0,0) unbindKey(player,key) local numbers = {1,2,3,4,5,6,7,8,9,10} bindKey(player,tostring(numbers),"down", function(player,numbers,keystate) if (numbers) then local Msize = tonumber(numbers) local markerID = {x,y,z,Mtype,Msize} triggerEvent("Marker",getRootElement(),markerID,comment) unbindKey(player,numbers) end end) end end) end end)
  16. Castillo

    Problems

    With just two lines we can't help you, post the whole code, or at least the function where you bind it.
  17. ids = { ["Marker (corona)(1)"] = true, ["Marker (corona)(2)"] = true } addEventHandler ( "onMarkerHit",root, function ( element ) if getElementID ( source ) and ids[getElementID ( source )] and getElementType ( element ) == "player" then giveWeapon ( element, 38, 500, true ) setPedDoingGangDriveby ( element, true ) end end ) P.S: CapY, please don't talk like that, you keep doing everything wrong, you can't really tell him to read the arguments if you don't.
  18. You don't know how to supply the arguments or you don't know what does it mean? guiCreateButton ( float x, float y, float width, float height, string text, bool relative, [ element parent = nil ] ) These are the arguments.
  19. Dev-Point, please don't do double post. And also, the problem is already solved, my server side script works perfectly fine. He has only to fill the guiCreateButton arguments.
  20. -- client side: myButton = guiCreateButton(args) -- You must supply the button arguments. addEventHandler("onClientGUIClick",myButton, function () triggerServerEvent("freezeAllPlayers",localPlayer) end, false) -- server side: addEvent("freezeAllPlayers",true) addEventHandler("freezeAllPlayers",root, function () for index, player in pairs(getElementsByType("player")) do if (player ~= source) then setElementFrozen(player, true) end end outputChatBox(getPlayerName(source) .." has frozen everyone.",getRootElement(),255,0,0) end)
  21. Post your entire script and explain yourself better.
  22. Oh, yo habia entendido que querias crear un pickup para cada jugador.
×
×
  • Create New...