Jump to content

Overkillz

Members
  • Posts

    545
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Overkillz

  1. Thanks, I got it, but when Im trying to draw the table, it doesnt work. Its something defineing wrongly ? for id=1,#killerTable do dxDrawText(killerTable[id]['killer'].. " Kills: "..killerTable[id]['killer']..playerKills,sX/2,sY/2,0,0,tocolor(255,255,255,255),1,"default-bold","left","top",false,false,false,true) end Thanks and regards.
  2. Thanks it worked pretty fine, however, there is a problem sorting the table. When are output, it drops the order depending of the first player that kill, later the 2nd killer and not following the order of kills. I tought it was a simple problem adding tonumber but it didnt work table.sort(killerTable,function(a,b) return (tonumber( a.playerKills )) < (tonumber( b.playerKills )) end) Also, there is a way to trigger a table ?
  3. Thanks mate, this is the alst thing that I will request you, how can I get the name of the Player from a table, I tried it but It dropped me an error. Also, to sort them dempending the number of kills it should be table.sort(killerTable [ killer ]) right. Thanks for your time.
  4. Thanks, both methods works fine. However, now Im looking for add the Killer with the number of kills that he has done. I tried to insert them into a table, but unlucky, I did something wrong. killerTable = {} if ( not killerTable [ killer ] ) then killerTable [ killer ] = { } end table.insert(killerTable [ killer ],1) I hope u can give me an easy way, I want to build a ranking table (dX) which shows the top killers
  5. Thanks so much, Im trying do do a DD Killer System but I cant get the idea on my mind how can I set a system to increase kills. Im already using the funciton onPlayerWasted (I wont use onClientPlayerWasted) because Im gonna use some other functions. function updateKiller() local thePlayer = getPlayerNametagText(source) local killer = getElementData(source,"lastHit") if killer then outputChatBox(thePlayer.." #ffffffhave been killed by: #00ff00"..killer,getRootElement(),255,255,255,true) end end addEventHandler( "onPlayerWasted", getRootElement(),updateKiller) I would apreciate you the idea for it.
  6. Hey dear community, Im having a simple issue with killTimer Well, my problem is that I want to remove the ElementData after 12 seconds if the car doesnt get another hit on this time, however, if he gets the hit, cancell the timer and restart it again. The script works pretty well, but Im getting a annoying message at DebugScript. function removeLastHit() setElementData(localPlayer, "ultimateHi", false) outputChatBox("Hit Removed | Time Exceded",255,255,255,true) end addEventHandler("onClientVehicleCollision", root, function ( hit ) if ( source == getPedOccupiedVehicle(localPlayer) ) then if getElementType ( hit ) == "vehicle" then if(getVehicleOccupant ( hit, 0 ) ~= false) then setElementData(localPlayer, "ultimateHi", "Whatever") killTimer ( killerCleaner ) killerCleaner = setTimer(removeLastHit,5000,1) end end end end ) - Image: http://puu.sh/ov64i/74e86c54c4.png I hope you can help me. Thanks for your time. Regards.
  7. Thanks guys, but I got another idea for it. I couldnt undestand the ways that you explained me, its weard because they looks easier than Im using.
  8. Hey dear guys, Im trying to create a new system to save some tables in a XML files, but I would like to know which functions should I use for them. Also, would be nice if I can see any example. Thanks for reading. Regards.
  9. try to search getActivePlayerCount() == 1 and change it for getActivePlayerCount() == 0 it should be near of RaceMode.endMap()
  10. Hey guys, im trying to create a multiple alpha on each message, its the first time that I do this but it doesnt work, when the player type /adda message it will add the message and I want the alpha start too on each message for individual messages local sX, sY = guiGetScreenSize() local sizeX = sX/2 local sizeY = sY/2 local lista = {} local alpha = {} function dxDrawAnimation() for i=1,#lista do alpha[i] = alpha[i] + 30 if alpha[i] >= 255 then alpha[i] = 255 end dxDrawText("Text: "..lista[i],sX/2-sizeX/2,(sY/2-sizeY/2)+10*(i-1),0,0,tocolor(255,255,255,alpha[i]),1,"default-bold","left","top",false,false,false,true) end end addEventHandler("onClientRender",getRootElement(),dxDrawAnimation) function rellenateTable(value) table.insert(lista,value) end addCommandHandler("adda",rellenateTable)
  11. Overkillz

    CPU Usage.

    Might this function will be usefull for you https://wiki.multitheftauto.com/wiki/DxGetStatus was implemented on the last update of MTA 1.5.2
  12. Overkillz

    anti-spam

    First of all, I think u should cancell the event. Seconds, you are only adding a function to mute a player without a reason try getPlayerName("player") Im not sure about what I told you, Im beggining on this ...
  13. and to select just a player, should be the same right ? I mean: currentPlayer = {} if not currentNumber[source] then currentPlayer[source] = source end to select an unique player to move later local vehicle = getPedOccupiedVehicle(currentPlayer[source]) and to set the position to an unique player setElementPosition(currentPlayer[source], posAnyX,posAnyy,posAnyz)
  14. Im using a table where I have a posX, posY, and posZ, there are some values insertered and I want to move the player when he press the key 1. It is done, but the unique problem is that Im having issues increasing the value. If more than 1 players use it, the variable increase for all, and I want to increase it for one each player. Example: Player 1 press 2 times the key: currentNumber: 2 player 2 press 2 times the key: currentNumber: 4 player 1 press again 2 times the key: currentNumber: 6 The player 1 jumped from a number: 2 to 6. I would like to fix it.
  15. Might someone can show me an example, I tried to do it triggering, but without results.
  16. I decided to use a triggerServerEvent from a client due to I cant stand tables. I couldnt test it due to Im alone at my server, but this should only move myself and increase the variable only for me? --## Client function triggerToSrv() triggerServerEvent("oncgSP", getLocalPlayer(),localPlayer) end addCommandHandler("chsp",triggerToSrv) --## Server currentNumber = 1 function chSP(source) local vehicle = getPedOccupiedVehicle(source) if vehicle then setElementPosition(vehicle, 300,500,2) end currentNumber = currentNumber+1 end addEvent("oncgSP",true) addEvent("oncgSP",getRootElement(),chSP)
  17. Well, now I got a new problem now If both guys are using the command to the same time, the variable " currentNumber " increase when it is used by anybody local currentNumber = 1 function setPositionasd(source) local vehicle = getPedOccupiedVehicle(source) if vehicle then setElementPosition(vehicle, 300,500,2) end currentNumber = currentNumber+1 end addCommandHandler("spD",setPositionasd) Its serverside, how can I set it using an easy way just for the local player without triggering our whatever ? Thanks
  18. EDIT: READ DOWN THIS POST Problem fixed, its weard to explain, outputDebugScritp 3 dropped me that there was a nil value. However, I quit out the variable from the function and it worked. Regards.
  19. Maybe this can help u local xml = xmlCreateFile("vehicledata.xml","vehicledata") xmlNodeSetAttribute(xml,"vehicletoSave","") local xmlFile = xmlLoadFile("vehicledata.xml","vehicledata") xmlNodeGetAttribute(xmlFile,"vehicledata") regards.
  20. Hey dear community, I have a little question about setElementPosition. When I want to set a position for the vehicle using this function changePos() local vehicle = getPedOccupiedVehicle(localPlayer) setElementPosition(vehicle, spPosX[3],spPosY[3],spPosZ[3]) end bindKey ( "1", "down", changePos ) it work's perfectly but when I try to use a variable as number, it doesnt works function changePos() local currentSpawn = 3 local vehicle = getPedOccupiedVehicle(localPlayer) setElementPosition(vehicle, spPosX[currentSpawn],spPosY[currentSpawn],spPosZ[currentSpawn]) end bindKey ( "1", "down", changePos ) Someone could tell me the reason. Thanks for all, regards.
  21. More less, Im trying to change the vehicle position to another spawn point pressing a key "2" however, when I try it, it just change only to a position and after changing it moves to the same position
  22. +1 to all (fX,fY,fZ) I know that fX or fY or fZ +1 just will change a bit from the position actual.
  23. Hey guys, I cant stand "for" at scripting due to I cant controll it. Well, my point is trying to change the position of the player where he spawned increasing the spawn point +1 function nombreas() local aSpawnPoints = getElementsByType( "spawnpoint" ) for i, pSpawnPoint in ipairs( aSpawnPoints ) do local fX, fY, fZ, RX, RY,RZ = tonumber( getElementData( pSpawnPoint, "posX" ) ), tonumber( getElementData( pSpawnPoint, "posY" ) ), tonumber( getElementData( pSpawnPoint, "posZ" ) ) local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then setElementPosition( vehicle, fX,fY,fZ ) outputChatBox("You changed spawn point",255,255,255,true) else outputChatBox("You are not alive",255,255,255,true) end end end bindKey ( "2", "down", nombreas ) I tried adding to fX,fY,fZ +1 but it didnt work too. I hope u can help me, thanks for your time
×
×
  • Create New...