Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Skins !!

    Here: for index, skin in ipairs(vehicles) do Should be: for index, skin in ipairs ( skins ) do
  2. Castillo

    Is there

    I'm not sure, but you can make your own with this function: setAccountPassword
  3. Tenes que usar table.concat: addCommandHandler ( "pr", function ( playerSource, commandName, ... ) local respuestas = { "Si", "No" } outputChatBox ( getPlayerName ( playerSource ) .."#00fbff, Ah preguntado: #fff000".. table.concat ( { ... }, " " ), getRootElement(), 0, 255, 255, true ) outputChatBox ( "Respuesta: ".. respuestas [ math.random ( #respuestas ) ], getRootElement(), 0, 255, 255, true ) end )
  4. Ya encontre el error, te habias olvidado de poner: respuestas [ math.random ( #respuestas ) ] copia el codigo de nuevo.
  5. marker = createMarker ( -2347.7023925781, -1638.6910400391, 483.703125, "cylinder", 2, 255, 255, 255, 255 ) winner = false function createTeamsOnStart ( ) teamwinner = createTeam ( "winner", 225, 255, 225 ) teamplayer = createTeam ( "player", 225, 255, 225 ) exports [ "scoreboard" ]:scoreboardAddColumn ( "wins" ) end addEventHandler ( "onResourceStart", resourceRoot, createTeamsOnStart ) function idc ( player ) if ( winner and isElement ( winner ) ) then setElementData ( winner, "wins", 0 ) end winner = player local currentWins = getElementData ( player, "wins" ) or 0 setElementData ( player, "wins", currentWins + 1 ) setPlayerTeam ( player, teamwinner ) givePlayerMoney ( player, 5000 ) outputChatBox ( "A Player has reached to the marker and earned 5000$ win 10 in a row and get spacial prize" ) for _, player in ipairs ( getElementsByType ( "player" ) ) do killPed ( player ) end end addEventHandler ( "onMarkerHit", marker, idc ) function idk ( player ) setPlayerTeam ( player, teamplayer ) end addEventHandler ( "onMarkerLeave",marker, idk ) That?
  6. Creo yo que tu problema es que no pusiste strings en la tabla. addCommandHandler ( "pr", function ( playerSource, commandName, pregunta ) local respuestas = { "Si", "No" } outputChatBox ( getPlayerName ( playerSource ) .."#00fbff, Ah preguntado: #fff000".. pregunta, getRootElement(), 0, 255, 255, true ) outputChatBox ( "Respuesta: ".. respuestas [ math.random ( #respuestas ) ], getRootElement(), 0, 255, 255, true ) end )
  7. You want to restrict certain vehicles to a certain gang?
  8. Castillo

    slothBot

    Supongo que editando el script de zombies, que verifique el tipo de elemento y si es un "player" lo ataque.
  9. Castillo

    some help

    getLocalPlayer is client side only, you must define the element that hit the marker, like this: function show ( thePlayer ) -- The first argument of this event is the element that hit it. if ( getPlayerTeam ( thePlayer ) == getTeamFromName ( "Medic" ) ) then moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) end end addEventHandler ( "onMarkerHit", checkGateMarker, onLeave )
  10. Castillo

    some help

    https://wiki.multitheftauto.com/wiki/GetPlayerTeam https://wiki.multitheftauto.com/wiki/GetTeamName Both have examples, read them and try to understand.
  11. This is not whichever the server you play forums, this is the MTA forums. Locked.
  12. You're welcome. P.S: That's a good way to learn: trial and fail.
  13. Castillo

    some help

    Is it that hard to try at least doing it?
  14. marker = createMarker ( -2347.7023925781, -1638.6910400391, 483.703125, "cylinder", 2, 255, 255, 255, 255 ) function createTeamsOnStart ( ) teamwinner = createTeam ( "winner", 225, 0, 225 ) exports [ "scoreboard" ]:scoreboardAddColumn ( "wins" ) end addEventHandler ( "onResourceStart", resourceRoot, createTeamsOnStart ) function idc ( player ) local currentWins = getElementData ( player, "wins" ) or 0 setElementData ( player, "wins", currentWins + 1 ) setPlayerTeam ( player, teamwinner ) givePlayerMoney ( player, 5000 ) outputChatBox ( "A Player has reached to the marker and earned 5000$ win 10 in a row and get spacial prize" ) end addEventHandler ( "onMarkerHit", marker, idc )
  15. I don't really understand what is a "base shop" script.
  16. Castillo

    some help

    We help you understand here, we don't make stuff for you. Read about: getPlayerTeam and getTeamName
  17. That's because: 1: at getPedOccupiedVehicle you use 'thePlayer', but you never defined it. 2: You are using 'onClientResourceStart' which is client side at the same time as 'onPlayerJoin' which is server side. 3: I think your whole script should be set server side. function giveNitro ( thePlayer ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if theVehicle then outputDebugString ( 'vehicle' ) addVehicleUpgrade ( theVehicle, 1010 ) else outputDebugString ( 'foot' ) end end function bindNitro ( ) outputDebugString ( 'loaded' ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "fire", "both", giveNitro ) end end addEventHandler ( "onResourceStart", resourceRoot, bindNitro ) function bindNitroForJoinedPlayer ( ) bindKey ( source, "fire", "both", giveNitro ) end addEventHandler ( "onPlayerJoin", root, bindNitroForJoinedPlayer ) This is a server side script.
  18. Castillo

    string

    http://lua-users.org/wiki/StringLibraryTutorial Mejor, imposible.
  19. You have to edit the scoreboard resource then.
  20. You want to set the player nametag color according to ping?
  21. jugador = getPlayerFromNamePart ( jugador )
  22. Post your entire code, including grid list and so on.
×
×
  • Create New...