-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
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 )
-
Ya encontre el error, te habias olvidado de poner: respuestas [ math.random ( #respuestas ) ] copia el codigo de nuevo.
-
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?
-
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 )
-
You want to restrict certain vehicles to a certain gang?
-
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 )
-
https://wiki.multitheftauto.com/wiki/GetPlayerTeam https://wiki.multitheftauto.com/wiki/GetTeamName Both have examples, read them and try to understand.
-
This is not whichever the server you play forums, this is the MTA forums. Locked.
-
You're welcome. P.S: That's a good way to learn: trial and fail.
-
Is it that hard to try at least doing it?
-
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 )
-
I don't really understand what is a "base shop" script.
-
We help you understand here, we don't make stuff for you. Read about: getPlayerTeam and getTeamName
-
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.
-
You have to edit the scoreboard resource then.
-
You want to set the player nametag color according to ping?
-
jugador = getPlayerFromNamePart ( jugador )
-
Post your entire code, including grid list and so on.
-
Que es lo que anda mal?