-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Copy the code again to show only the player who used the command.
-
function setMyTeam( player, cmd, ... ) local name = table.concat({...}, " ") if (name and name ~= "") then local team = getPlayerTeam( player ) if (not team) then if setPlayerTeam ( player, getTeamFromName( name ) ) then outputChatBox( "Your team now is "..getTeamName( getPlayerTeam( player ) )..".", player, 0, 255, 0 ) else outputChatBox( "Can't set to team.", player, 255, 0, 0 ) end else outputChatBox( "Alreadly in team.", player, 255, 0, 0 ) end else outputChatBox( "SYNTAX: /newteam [team name].", player, 255, 0, 0 ) end end addCommandHandler ( "changeteam", setMyTeam ) I think the command "/newteam" is part of the Admin panel, that's why I renamed it to "/changeteam".
-
To change the DD/DM win message: "race/modes/destructionderby.lua"
-
Cambie el "memo" a un "edit" y ahora funciona: function GUI() window = guiCreateWindow(15,75,500,500,"Admin Adding Car",false) guiWindowSetMovable( window, false ) guiWindowSetSizable( window, false ) memo = guiCreateEdit(150,100,250,50,"",false,window) ok = guiCreateButton(100, 100, 50, 50,"OK",false,window) label = guiCreateLabel(13,35,500,100,"Cars:",false,window) guiLabelSetColor(label,255,255,255) guiLabelSetVerticalAlign(label,"top") guiLabelSetHorizontalAlign(label,"left",false) exit = guiCreateButton(171,19,19,19,"X",false,window) guiSetVisible(window,false) addEventHandler("onClientGUIClick",exit,exitGUI,false); addEventHandler("onClientGUIClick",ok,okcar,false); end addEventHandler("onClientResourceStart",resourceRoot,GUI) function openTeleportWindow() local PlayerName = getPlayerName(getLocalPlayer()) if PlayerName == "BLABLA" then guiSetVisible(window,true) showCursor(true,true) end end addCommandHandler("OpenGUI",openTeleportWindow) function exitGUI() if (source == exit) then guiSetVisible(window,false) showCursor(false) end end function okcar(button,state) if (button == "left" and state == "up") then local text = tostring(guiGetText ( memo )) outputChatBox ( text ) if (text == "stats") then outputChatBox("BLABLA",255,0,0) end end end
-
local restriction = {} function fck(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFF ".. getPlayerName(player) .." Fck You! #abcdef(type: /fu)", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000You must wait 5 seconds to write this command again.", player, 255, 255, 255, true) end end addCommandHandler("fck", fck) function hateMap(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFFI ".. getPlayerName(player) .." I hate this map! #abcdef(type: /hatemap)", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000You must wait 5 seconds to write this command again.", player, 255, 255, 255, true) end end addCommandHandler("hatemap", hateMap) function loveYou(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFFI ".. getPlayerName(player) .." I love you :-* #abcdef(type: /ilu)", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000You must wait 5 seconds to write this command again.", player, 255, 255, 255, true) end end addCommandHandler("ilu", loveYou)
-
function GUI() window = guiCreateWindow(15,75,500,500,"Admin Adding Car",false) guiWindowSetMovable( Window, false ) guiWindowSetSizable( Window, false ) memo = guiCreateMemo(150,100,250,50,"",false,window) ok = guiCreateButton(100, 100, 50, 50,"OK",false,window) label = guiCreateLabel(13,35,500,100,"Cars:",false,window) guiLabelSetColor(label,255,255,255) guiLabelSetVerticalAlign(label,"top") guiLabelSetHorizontalAlign(label,"left",false) exit = guiCreateButton(171,19,19,19,"X",false,window) guiSetVisible(window,false) addEventHandler("onClientGUIClick",exit,exitGUI,false); addEventHandler("onClientGUIClick",ok,okcar,false); end addEventHandler("onClientResourceStart",resourceRoot,GUI) function openTeleportWindow() local PlayerName = getPlayerName(getLocalPlayer()) if PlayerName == "BLABLA" then guiSetVisible(window,true) showCursor(true,true) end end addCommandHandler("OpenGUI",openTeleportWindow) function exitGUI() if (source == exit) then guiSetVisible(window,false); showCursor(false); end end function okcar(button,state) if (button == "left" and state == "up") then local text = guiGetText ( memo ) outputChatBox ( text ) if (string.lower(text) == "stats") then outputChatBox("BLABLA",255,0,0) end end end
-
Postea el script completo.
-
This could help maybe? https://wiki.multitheftauto.com/wiki/OnPlayerContact
-
Oh, me confundi con los skins, lo que tenes que usar es el modelo del objeto del arma, no la ID del arma.
-
function fixAllVehicles(thePlayer, commandName) if (exports.global:isPlayerAdmin(thePlayer)) then local username = getPlayerName(thePlayer) for key, value in ipairs(exports.pool:getPoolElementsByType("vehicle")) do fixVehicle(value) setVehicleEngineState(value, true) exports['anticheat-system']:changeProtectedElementDataEx(value, "enginebroke", 0, false) exports['anticheat-system']:changeProtectedElementDataEx(value, "engine", 0, false) if armoredCars[ getElementModel( value ) ] then setVehicleDamageProof(value, true) else setVehicleDamageProof(value, false) end end outputChatBox("All vehicles repaired by Admin " .. username .. ".") end end addCommandHandler("fixvehs", fixAllVehicles)
-
-- server side: addEventHandler("onPlayerWasted",root, function () local team = getPlayerTeam(source) if (team) then setElementData(source,"tempTeam",getTeamName(team)) end end) addEventHandler("onPlayerSpawn",root, function () local team = getElementData(source,"tempTeam") if (team and getTeamFromName(team)) then setPlayerTeam(source,getTeamFromName(team)) end end) That script should save the team on wasted and load it on spawn.
-
Yo te dije que 3 porque el modelo del arma que intentas remplazar es el 3 .
-
You're welcome. P.S: I hope so lol.
-
Try this: function globalOOC(thePlayer, commandName, ...) local logged = tonumber(getElementData(thePlayer, "loggedin")) if (logged==1) then if not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Message]", thePlayer, 255, 194, 14) else local oocEnabled = exports.global:getOOCState() message = table.concat({...}, " ") local muted = getElementData(thePlayer, "muted") if (oocEnabled==0) and not (exports.global:isPlayerAdmin(thePlayer)) then outputChatBox("OOC Chat is currently disabled.", thePlayer, 255, 0, 0) elseif (muted==1) then outputChatBox("You are currenty muted from the OOC Chat.", thePlayer, 255, 0, 0) else local players = exports.pool:getPoolElementsByType("player") local playerName = getPlayerName(thePlayer) local playerID = getElementData(thePlayer, "playerid") local r, g, b = getPlayerNametagColor(thePlayer) local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") local adminLevel = exports.global:getPlayerAdminLevel(thePlayer) exports.logs:logMessage("[OOC: Global Chat] " .. playerName .. ": " .. message, 1) for k, arrayPlayer in ipairs(players) do local logged = tonumber(getElementData(arrayPlayer, "loggedin")) local targetOOCEnabled = getElementData(arrayPlayer, "globalooc") if (logged==1) and (targetOOCEnabled==1) then if exports.global:isPlayerAdmin(thePlayer) then if (hiddenAdmin == 0) then if (adminLevel >= 1 and adminLevel < 4) then outputChatBox("(( [GOOC] #00FF00[" .. tostring(adminTitle) .. "]#FFFFCC (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204, true) elseif (admniLevel > 4) then outputChatBox("(( [GOOC] #FF0000[" .. tostring(adminTitle) .. "]#FFFFCC (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204, true) end else if (exports.global:getPlayerDonatorLevel(thePlayer) > 0) then outputChatBox("(( [GOOC] [Donator] (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204, true) else outputChatBox("(( [GOOC] (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204, true) end end else if (exports.global:getPlayerDonatorLevel(thePlayer) > 0) then outputChatBox("(( [GOOC] [Donator] (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204, true) else outputChatBox("(( [GOOC] (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204, true) end end end end end end end end addCommandHandler("o", globalOOC, false, false) addCommandHandler("GlobalOOC", globalOOC)
-
No, is not. The only way would be scripting your own CHAT BOX system, trust me, is not going to be easy .
-
I have changed something, is not the same as the previous. You can't change the chatbox message fonts.
-
Ese script no funciona? deberia funcionar. Intenta cambiar el 0 por 3 en engineLoadDFF.
-
function giveAllMoney(thePlayer, commandName, money) if (exports.global:isPlayerLeadAdmin(thePlayer)) then if (not money) then outputChatBox("SYNTAX: /" .. commandName .. " [Money]", thePlayer, 255, 194, 14) else local username = getPlayerName(thePlayer) local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) exports.global:sendMessageToAdmins("AdmCmd: " .. getPlayerName(thePlayer) .. " gave all players online " .. money .. " dollars.") outputChatBox("You have given $" .. money .. " to all players ", thePlayer) for index, player in ipairs(getElementsByType("player")) do exports.global:giveMoney( player, tonumber( money ) ) outputChatBox("Admin " .. username .. " has given you $" .. money .. ".", player) end outputChatBox(" " .. tostring(adminTitle) .. " " .. getPlayerName(thePlayer) .. " gave all players online " .. money .. " dollars.", getRootElement(), 255, 0, 51) end end end addCommandHandler("giveallmoney", giveAllMoney, false, false) I tested it and seems to work.
-
Eshtiz: Don't listen to Evil-Codr, he's a newbie, this is server side, not client side. And it should work, I don't know much about Valhalla Scripts.
-
Copy the script again, I've changed a few things.
-
Eso no tiene sentido, porque no usas el script que poste y listo?
-
-- client side: addEventHandler("onClientPlayerDamage",root, function (attacker) if (getElementModel(source) == getElementModel(attacker)) then cancelEvent() end end)
-
Well, then you should learn English, because what I understood was that you wanted to make a script to stop player's from getting grenades by "/gun". I don't know much about Basemode either.