Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. El script que Cocodrilo posteo es lo mismo que el tuyo, no veo la razon por la cual era necesario que vos pusieras lo mismo.
  2. CSG wasn't hacked, and Will Briggs is not part of CSG anymore.
  3. triggerServerEvent("Polis", getLocalPlayer() ) Change it to: triggerServerEvent ( "Polis", localPlayer, localPlayer )
  4. That script can't make a player time out. Plus, I only edited the script, I didn't make it.
  5. Castillo

    Gang

    You're welcome.
  6. He's not the one who bumped it, that would be Alexs_Steel, as you can see, his post is from 23 Jan 2014.
  7. Already suggested: https://bugs.multitheftauto.com/view.php?id=6743
  8. addEventHandler ( "onPlayerQuit", root, function ( ) local account = getPlayerAccount ( source ) if ( not isGuestAccount ( account ) ) then setAccountData ( account, "totalDrift", getElementData ( source, "Total Drift" ) ) end end ) That'll save the drift on quit, now you have to make the script to load it. Use the event: onPlayerLogin with the following functions: getAccountData setElementData
  9. To save it you must get the element data "Total Drift" when the player quits and save it using setAccountData.
  10. addCommandHandler -- Para agregar el comando getPedOccupiedVehicle -- Para obtener el vehiculo de un jugador. blowVehicle -- Para explotar el vehiculo.
  11. Well, the best drift is already being saved ( is what ranks use ), and total drift, you can save it same way as best drift.
  12. If it doesn't output anything, then you either copied what I gave you wrong, or you aren't drifting at all, since I just tested it and it did output something when I finished my drift. Download this: https://www.dropbox.com/s/hzpl4b1bc8knlpx/resources.rar it contains both drift and drift rank resources.
  13. Yes, but does it output something to the chat box?
  14. Castillo

    Help ME!

    He's asking for a resource to save the team colour, not help to make one, so I guess it's in the correct section?
  15. Castillo

    Gang

    function criarGang ( source, commandName, teamName ) local getaMoney = getPlayerMoney ( source ) if ( teamName ) then if ( getaMoney < 400000 ) then outputChatBox ( "#F4A460[GANG]#F08080 Você não tem dinheiro suficiente para criar uma gang Valor 400000$", source, 255, 255, 255, true ) else if ( getPlayerTeam ( source ) ~= false ) and ( countPlayersInTeam ( getPlayerTeam ( source ) ) == 1 ) then destroyElement ( getPlayerTeam ( source ) ) outputChatBox("#F4A460[GANG]#F08080 Sua gang antiga foi deletada e foi criada uma nova!",source,255,255,255,true) end local newTeam = createTeam ( teamName ) if ( newTeam ) then takePlayerMoney ( source, 400000 ) local getGang = getTeamName ( newTeam ) setTeamColor ( newTeam, math.random ( 0, 255 ), math.random ( 0, 255 ), math.random ( 0, 255 ) ) setPlayerTeam ( source, newTeam ) local playerTeam = getPlayerTeam ( source ) outputChatBox ( "#F4A460[GANG]#F08080 Gang criada com sucesso!! Valor 4.000$", source, 255, 255, 255, true ) end end else outputChatBox ( "#F4A460[GANG]#F08080 Uso correto: /fundargang [nome]", source, 255, 255, 255, true ) end end addCommandHandler ( "gangcriar", criarGang ) addEventHandler ( "onPlayerLogin", root, function ( _, account ) local team = getAccountData ( account, "team" ) if ( team == getTeamName ( getTeamFromName ( team ) ) ) then setPlayerTeam ( source, getTeamFromName ( team ) ) end end ) function save ( ) local team = getPlayerTeam ( source ) local account = getPlayerAccount ( source ) if ( not isGuestAccount ( account ) ) then if ( team ) then setAccountData ( account, "team", getTeamName ( team ) ) end end end addEventHandler ( "onPlayerLogout", root, save ) addEventHandler ( "onPlayerQuit", root, save ) function sairDaGang ( source ) local playerTeam = getPlayerTeam ( source ) if ( playerTeam ) then setPlayerTeam ( source, nil ) outputChatBox ( "#F4A460[GANG]#F08080 Você saiu da gang", source, 255, 255, 255, true ) else outputChatBox ( "#F4A460[GANG]#F08080 Você não tem gang", source, 255, 255, 255, true ) end end addCommandHandler ( "gangabandonar", sairDaGang ) function desfazerGang ( source ) local playerVeri = getPlayerTeam ( source ) if ( playerVeri ) then destroyElement ( playerVeri ) outputChatBox ( "#F4A460[GANG]#F08080 Você deletou sua gang", source, 255, 255, 255, true ) else outputChatBox ( "#F4A460[GANG]#F08080 Você não tem gang", source, 255, 255, 255, true ) end end addCommandHandler ( "gangdeletar", desfazerGang ) function enviarGang ( source, cmd, targetPlayer ) if ( targetPlayer ) then local target = getPlayerFromName ( targetPlayer ) if ( target ) then local geta = getPlayerName ( target ) local gang = getPlayerTeam ( source ) local getName = getTeamFromName ( source ) local lala = getTeamName ( source ) local convidado = true setElementData ( target, "gangConvite", gang, false ) if ( gang == getName ) then outputChatBox ( "#F4A460[GANG]#F08080 Você não pertence a nenhuma gang",source, 255, 255, 255, true ) else outputChatBox ( "#F4A460[GANG]#F08080 Convite de recrutamento enviado para ".. tostring ( targetPlayer ), source, 255, 255, 255, true ) outputChatBox ( "#F4A460[GANG]#F08080 Você foi convidado para o recrutamento digite /aceitargang Gang: ".. getTeamName ( gang ), target, 255, 255, 255, true ) end end end end addCommandHandler ( "gangconvite", enviarGang ) function Recrutamento ( source ) local gangConvite = getElementData ( source, "gangConvite" ) if isElement ( gangConvite ) then outputChatBox("#F4A460[GANG]#F08080 Você entrou na gang ".. getTeamName ( gangConvite ),source, 255, 255, 255, true) setPlayerTeam ( source, gangConvite ) else outputChatBox ( "#F4A460[GANG]#F08080 Você não foi convidado para nenhuma gang", source, 255, 255, 255, true ) end end addCommandHandler ( "gangaceitar", Recrutamento ) function Infor ( source ) outputChatBox ( "#F4A460[GANG]#F08080 Use : /gang|criar|convite|deletar|tag|sair|abandonar|", source, 255, 255, 255, true ) end addCommandHandler ( "gang", Infor )
  16. local garages = -- Define a table with few positions { { 0, 0, 0, 0, 0, 0 }, { 0, 123, 0, 0, 0, 2 }, { 465, 0, 0, 0, 0, 87 } } local curGarage = 1 -- Define a variable with 1 as value function showGarage ( cmd ) if ( garages [ curGarage ] ) then -- If the garages table contains the index specified in 'curGarage' variable... setCameraMatrix ( unpack ( garages [ curGarage ] ) ) -- Unpack the table value from that index and set the camera position. end end addCommandHandler ( "garage", showGarage ) function switchGarage ( key ) if ( key == "arrow_l" ) then if ( curGarage > 1 ) then curGarage = ( curGarage - 1 ) -- Lower the 'curGarage' variable by 1 end else if ( #garages > curGarage ) then curGarage = ( curGarage + 1 ) -- Increment the 'curGarage' variable by 1 end end showGarage ( ) end bindKey ( "arrow_l", "down", switchGarage ) bindKey ( "arrow_r", "down", switchGarage ) The positions in 'garages' table are just to show you how it works, you can add as much as you want.
  17. Create a table containing all the camera positions, and store the current table index in a table, then you increment it once he presses the key and obtain the camera position out of that index.
  18. Yes, you can use one of these events.
  19. Element data is meant to exist as long as the element exist.
  20. Try copying my code again.
  21. Creation: executeSQLQuery ( "CREATE TABLE IF NOT EXISTS `?` ( playerName TEXT, playerSerial TEXT, timeMS REAL, timeText TEXT, dataRecorded TEXT, extra TEXT )", mapname ) Inserting: executeSQLQuery ( "INSERT INTO `?` ( `playerName`, `playerSerial`, `timeMS`, `timeText`, `dataRecorded`, `extra` ) VALUES ( ?, ?, ?, ?, ?, ? )", map, playerName, playerSerial, timeMS, timeText, dataRecorded, extra )
  22. Just use the new MTA compiler: https://luac.multitheftauto.com/.
  23. Post the whole query, not just a part of it.
  24. I suggest you to use queries like this: executeSQLQuery("INSERT INTO players(name,color,sound) VALUES(?,?,?)", playerName, colorName, soundName )
×
×
  • Create New...