-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
Sorry but How to ban a player with number that I writed on Edit(Minutes). and only ban If I write a reason. Server-side: function banear(text, adminBanner, timeBan, editText) thePlayer = getPlayerFromName(text) if not thePlayer then outputChatBox("Selecciona a un jugador de la lista", source,255,0,0,true) return end if tonumber(timeBan) then theTimeBan = math.floor(tonumber(timeBan)*60*1000) banPlayer(thePlayer, false, false, true, adminBanner, editText, theTimeBan) end end addEvent("banHim", true) addEventHandler("banHim", getRootElement(), banear) Client-Side: function banearButton (text, adminBanner, timeBan, editText) if source == banButton then local timeBan = guiGetText(timeEdit) local selected = guiGridListGetSelectedItem( playerLista ) local text = guiGridListGetItemText( playerLista, selected, 1 ) local editText = guiGetText( reasonEdit ) local adminBanner = getPlayerName(getLocalPlayer()) if timeBan then triggerServerEvent("banHim", root, text, adminBanner, timeBan, editText) else outputChatBox("Escribe el tiempo de duracion",255,0,0,false) end end end addEventHandler("onClientGUIClick", root, banearButton)
-
Debes ser el resource publico de 50p https://community.multitheftauto.com/ind ... ails&id=54
-
Ese evento es client-side y por lo que se el tiene un script server-side ya que tiene killPed. Podrias usar: onVehicleDamage https://wiki.multitheftauto.com/wiki/OnVehicleDamage
-
Oh yes. Thanks @#Pai_[N] and @OGF its work
-
When No reasons it kick the player but if I write a reason it doesnt kick the player. Error on debug 3: Bad Argument @ 'kickPlayer'
-
playerLista = guiCreateGridList(10, 67, 187, 448, false, punishWindow) columnPlayers = guiGridListAddColumn( playerLista, "Jugadores", 0.85 ) function update ( old, new ) if ( eventName == "onClientPlayerJoin" ) then guiGridListSetItemText ( playerLista, guiGridListAddRow ( playerLista), columnPlayers, getPlayerName ( source ), false, false ) elseif ( eventName == "onClientPlayerQuit" ) then for row = 0, guiGridListGetRowCount ( playerLista) do if ( guiGridListGetItemText ( playerLista, row, columnPlayers) == getPlayerName ( source ) ) then guiGridListRemoveRow ( playerLista, row ) break end end elseif ( eventName == "onClientPlayerChangeNick" ) then for row = 0, guiGridListGetRowCount ( playerLista) do if ( guiGridListGetItemText ( playerLista, row, columnPlayers) == old ) then guiGridListSetItemText ( playerLista, row, columnPlayers, new, false, false ) break end end end end addEventHandler ( "onClientPlayerJoin", root, update ) addEventHandler ( "onClientPlayerQuit", root, update ) addEventHandler ( "onClientPlayerChangeNick", root, update ) function getAllPlayers ( ) guiGridListClear( playerLista ) for i,v in ipairs( getElementsByType( "player" ) ) do local row = guiGridListAddRow( playerLista ) guiGridListSetItemText( playerLista, row, 1, getPlayerName( v ), false, false ) end end
-
@A Concerned Citizen wtf ? ._. I use a botton to kick the player and I said that appear in chat "Player has been kicked by Admin : Reason". I know outputChatBox but I dont know how to make variables
-
Server-side: local name = "" local reason = "" function kickear(source) local nombre = getPlayerFromName(name) kickPlayer(nombre, reason) end addEvent("onPlayerKick", true) addEventHandler("onPlayerKick", getRootElement(), kickear) Client-side: function kickearButton(button, source, name, reason) if (button == kickButton) then triggerServerEvent("onPlayerKick", source, guiGetText( guiGridListGetSelectedItems ( playerLista ) ), guiGetText ( reasonEdit ) ) end end addEventHandler("onClientGUIClick", root, kickearButton) Nothings happened. And... How can I do when kick a player appear in the chat "Player has been kicked by Admin : Reason" ?
-
and add the function to the open function, Like this : function ( ) if guiGetVisible( window ) then guiSetVisible( window, false ) showCursor( false ) guiSetInputEnabled( false ) else guiSetVisible( window, true ) showCursor( true ) guiSetInputEnabled( true ) getAllPlayers( ) end end ) Its works. Thanks All.
-
function update ( old, new ) if ( eventName == "onClientPlayerJoin" ) then for i,v in ipairs(getElementsByType("player")) do guiGridListSetItemText ( playerLista, guiGridListAddRow (playerLista), columnPlayers, v, false, false ) end elseif ( eventName == "onClientPlayerQuit" ) then for row = 0, guiGridListGetRowCount ( playerLista) do for i,v in ipairs(getElementsByType("player")) do if ( guiGridListGetItemText ( playerLista, row, columnPlayers) == v ) then end guiGridListRemoveRow ( playerLista, row ) break end end elseif ( eventName == "onClientPlayerChangeNick" ) then for row = 0, guiGridListGetRowCount ( playerLista) do if ( guiGridListGetItemText ( playerLista, row, columnPlayers) == old ) then guiGridListSetItemText ( playerLista, row, columnPlayers, new, false, false ) break end end end end addEventHandler ( "onClientPlayerJoin", root, update ) addEventHandler ( "onClientPlayerQuit", root, update ) addEventHandler ( "onClientPlayerChangeNick", root, update ) Correctly? But doesnt work and any error on debug 3 U.U
-
I did that but doesnt work.
-
Doesnt work and no error on debug 3 . P.D.: Can I use to do public resource?
-
How can I do to create a one a row for player and no create much row of the same player ? And also How can I do to uptade the list? function actualizarLista() if ( columnPlayers ) then for id, player in ipairs(getElementsByType("player")) do row = guiGridListAddRow ( playerLista ) guiGridListSetItemText ( playerLista, row, columnPlayers, getPlayerName ( player ), false, false ) end end end addEventHandler("onClientPlayerJoin", getRootElement(), actualizarLista) addEventHandler("onClientPlayerChangeNick", getRootElement(), actualizarLista) addEventHandler("onClientResourceStart", getRootElement(), actualizarLista)
-
function menushow () visibleornot = guiGetVisible (theWindow2) if (Visibleornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) elseif (Visibleornot == false) then guiSetVisible (theWindow2, true) showCursor (true) local getoccup = getElementData( getLocalPlayer(), "Occupation" ) guiSetText(label,"Your Correct Occupation: "..getoccup,false) end end
-
gate = createObject(980, 551.5, 1659.300488281, 8.8000001907349, 0, 0, 121.99768066406) function gateOpen() moveObject( gate, 2000, 551.59997558594, 165.1999511719, 14.30000190735 ) end addCommandHandler("go1", gateOpen)--Command /go1 to open gate function gateClose() moveObject( gate, 2000, 551.59997558594, 165.1999511719, 14.30000190735 ) end addCommandHandler("gc1", gateClose)--Command /gc1 to close gate
-
Use boolean true on getElementData as argument 3. local data = getElementData(vehicle,"haveneon", true)
-
function onPlayerNuevoQuit() local playeraccount = getPlayerAccount(source) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then if (not getAccountData(playeraccount, "nuevo")) then setAccountData(playeraccount, "nuevo", "viejo") end end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerNuevoQuit) function playerViejo() local account = getPlayerAccount(source) if (getAccountData(account, "nuevo") == "viejo") then spawnPlayer (source, 2312.84375, -1.3126500844955, 26.7421875, 0, math.random (280,288), 0, 0) outputChatBox("Bienvenido de Vuelta "..getPlayerName(source).. "Diviertete!", source, 255, 0, 0, 255) end end addEventHandler("onPlayerLogin", getRootElement(), playerViejo) function onPlayerRegister(_, playeraccount) if (not getAccountData(playeraccount, "nuevo")) then setCameraMatrix(source, 2350.2368164063, 69.811370849609, 26.484375, 2340.9641113281, 12.886473655701, 26.3359375) setTimer(setCameraMatrix, 8000, 1, source, 2272.8959960938, -32.551116943359, 26.339841842651, 2315.6574707031, -28.518367767334, 26.3359375) end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerRegister)
-
Ademas estas usando el evento de onPlayerQuit. Crea una funcion aparte.
-
https://community.multitheftauto.com/index.php?p= ... ls&id=6589 -.-'