-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
Is there a better way to output an error message on debugscript instead of make a lot of if's conditional? function dxCreateWindow ( x, y, width, height, titleBarText, relative, windowBarColor, windowColor ) if type(x) == "number" then if type(y) == "number" then if type(width) == "number" then if type(height) == "number" then if type(titleBarText) == "string" then if type(relative) == "number" then -- else return outputDebugString("[dxCreateWindow]: expected number at argument 6, got "..type(relative), 3) end else return outputDebugString("[dxCreateWindow]: expected string at argument 5, got "..type(titleBarText), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 4, got "..type(height), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 3, got "..type(width), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 2, got "..type(y), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 1, got "..type(x), 3) end end
-
Con el (hitElement == localPlayer) basta para saber que es un jugador por lo que no es necesario esto (getElementType(hitElement) == "player"). Ademas, para poder reducir las lineas de tu script, en vez de hacer varios if puedes ponerlo todo en uno colocando un 'and' por cada condicion que intentas hacer. function spawnearVehiculoT(hitElement) if hitElement == localPlayer and getElementModel(localPlayer) == 202 and not isPedInVehicle(localPlayer) then if not guiGetVisible(windowVehTrucker) then guiSetVisible(windowVehTrucker, true) showCursor(true) else if getElementModel (localPlayer) == 202 then guiSetVisible(windowVehTrucker, false) showCursor(false) end end end end addEventHandler("onClientMarkerHit", markerVehiculoT1, spawnearVehiculoT) Te recomiendo que leas la parte basica del manual de lua. Cualquier duda posteala. Suerte!
-
Maybe he has voice volume set to 0.
-
local setPlayerNewName = setPlayerName function getPlayerSuperNick( ) local player = source local account = getPlayerAccount( player ) if ( account ) and ( not isGuestAccount( account ) ) then local accountSuperNick = getAccountData(account,"supernick") if ( accountSuperNick ) then local supernick = getElementData(player,"supernick") if ( supernick ) then setPlayerNewName(player,supernick) outputChatBox(supercolor.."[supernick]: #FFFFFFYour "..supercolor.."supernick #FFFFFFhas been set to "..supercolor..getElementData(player,"supernick"),player,255,255,255,true) end end end end addEventHandler("onPlayerLogin",getRootElement(),getPlayerSuperNick) function savePlayerSuperNick( ) local player = source local account = getPlayerAccount( player ) if ( account ) and ( not isGuestAccount( account ) ) then local supernick = getElementData(player,"supernick") if ( supernick ) then setAccountData(account,"supernick",supernick) end end end addEventHandler("onPlayerQuit",getRootElement(),savePlayerSuperNick) The first variable that onPlayerLogin returns is the previous account so obviously it will never be the player and onPlayerQuit doesnt return variables.
-
Y no te aparece algún error en el debugscript 3? La imagen esta incluida en el meta o estas seguro de que la "id" que proporciona es correcta?
-
I think you can disable "action"
-
Oh sorry. Put triggerClientEvent function outside the loop or copy the code again.
-
Maybe the problem is with 'isAllownedPlayer' function, what does it do? EDIT: Try it: Server: addCommandHandler("tirarsoco", function (sourcePlayer) local list9 = 0 local playerTable = {} for _ , v in ipairs ( getElementsByType ('player' )) do -- if not (isAllownedPlayer(v)) then return end local isPlayerInEvento = getElementData( v, "Evento" ) if (isPlayerInEvento) then setElementData(v, "soco", true) outputChatBox("#FFF000[EVENTO]#FFFFFF "..getPlayerName(sourcePlayer).." Deleted your hands", v, 255, 255, 255, true) list9 = list9 + 1 playerTable[v] = true end triggerClientEvent("onDeleteHands", root, playerTable) outputChatBox("#FFF000[EVENTO]#FFFFFF You deleted soco of "..list9.." players", sourcePlayer, 255, 255, 255, true) end end) Client: function dontFight(_, slot) if slot == 0 and getElementData(localPlayer, "soco") then toggleControl ( "fire", false ) elseif slot ~= 0 and getElementData(localPlayer, "soco") then toggleControl ( "fire", true) else toggleControl ( "fire", true) removeEventHandler("onClientPlayerWeaponSwitch", root, dontFight) end end addEvent("onDeleteHands", true) addEventHandler("onDeleteHands", root, function(playerTable) if playerTable[localPlayer] then dontFight(_, getPedWeaponSlot(localPlayer)) addEventHandler("onClientPlayerWeaponSwitch", root, dontFight) end end)
-
I don't know if we can cancel 'onClientPlayerWeaponFire' event but in case it can't you can try this: function dontFight(_, slot) if slot == 0 and getElementData(localPlayer, "soco") then toggleControl ( "fire", false ) elseif slot ~= 0 and getElementData(localPlayer, "soco") then toggleControl ( "fire", true) else toggleControl ( "fire", true) removeEventHandler("onClientPlayerWeaponSwitch", root, dontFight) end end) addEventHandler("onClientPlayerWeaponSwitch", root, dontFight)
-
addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "Y", "down", "chatbox", "gangChat" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "Y", "down", "chatbox", "gangChat" ) end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA [GangChat] "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) and getElementType( playerToInvite ) == "player" then -- At function 'getElementType' you have 'argument' as the argument but this variable doesn't exist so I supposed is 'playerToInvited' setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end end addCommandHandler ( "invite", invitePlayer )
-
Try to put an outputChatBox to test if the event "onPlayerUnmute" has been activated.
-
Did you try with the gridlist element?
-
Hey there people I'm so tired forgotten password emails on my server not being delivered or delivered to Junk Mail.. I registered on http://mandrill.com and they give you 12,000 Free mails to send with 250 per hour which is is pretty good.. The thing is I DONT have a clue on how to send password recovery emails with SMTP they give all the details and passwords I even set SMF to send emails using SMTP and works like a charm everything is configured exept I dont have a clue on how to send Emails using the mta-sdk
-
I see. Thanks everything is running great so far so good thanks
-
I dint got any error. Only installed the following packages zip unzip ia32-libs lib32ncursesw5 lib32readline5 screen Aparently the problem was that I was trying to install libreadline5-dev and some others, well hope they are not needed Thanks guys pd. Ohh I forgot to tell is subversion needed?
-
Hey guys, any body can tell me what packages are needed to run a MTA Server on Debian 7.5 [64 Bits]? I currently run Debian 6 [64 Bits] because I installed Debian 7.5 yesterday but when I was trying to install all the packages required from the MTA Wiki apt-get install build-essential automake libtool libcurl4-openssl-dev libpcre3-dev apt-get install libsqlite3-dev libreadline5-dev subversion libncurses5-dev apt-get install libncursesw5-dev libsparsehash-dev libmysqlclient-dev apt-get install zip unzip ia32-libs lib32ncursesw5 lib32readline5 Apparently lib32ncursesw5 lib32readline5 libreadline5-dev where unable to install because there was another replacement, anyways can someone give me all the list of packages to run a MTA Server on Debian 7.5 [64 Bits]? Thank You
-
Tenia este script que hace justo lo que vos queres. Insults = { "ejemplo", "estupido" } -- Aqui pones las palabras no deseadas addEventHandler("onPlayerChat", root, function(msg, msgType) if msgType == 0 then for k,v in ipairs (Insults) do if string.find( string.lower ( msg ), v) then msg = string.gsub ( string.lower( msg ), v, string.rep("*", wordToAsteric(v) ) ) end end local playerAcc = getPlayerAccount(source) if isGuestAccount(playerAcc) then cancelEvent() else outputChatBox(getPlayerName(source)..": #FFFFFF"..msg, root, 255, 255, 255, true) outputServerLog("CHAT: "..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..": "..msg) cancelEvent() end end end ) function wordToAsteric(theWord) if type(theWord) == 'string' then return string.len(theWord) end end
-
Tan solo debes verificar si el matador es el player local y ejecutarlo. Así: function getMedalWithHeadshot(matador, arma, partedelcuerpo ) if matador and matador == localPlayer then if ( partedelcuerpo == 9 ) then createImageForMedalWithHeadshot() triggerServerEvent ( "giveheadshot", matador) outputDebugString("[ZEI]Stats"..getPlayerName(matador).." hizo un headshot.") end end end addEventHandler ( "onClientPlayerWasted", getRootElement(), getMedalWithHeadshot )
-
You can take a look at my old post: viewtopic.php?f=91&t=61094&hilit=+nearest
-
Hello People!, I was playing on my server but always in the "Drug Fabric Robbery" many people crash. The Drug Fabric Robbery usually takes place with around 100+ players on peak hours and most of those players crash by Unknown reason. I have the dumps of a crash while I was aiming at a player using the sniper then MTA Crashed instantly. Here are the dumps: http://192.99.17.190/misc/public.rar PS. I didn't see a need of posting MTA Diag since I have all my right drivers and there is no much software running when I'm playing MTA only thing I have is Comodo Firewall but I doubt that has anything to do. I you guys need MTA Diag I'll post it just let me know. Have a Nice Day
-
I Didn't knew you people can issue MTA Global ban o_o' That's impressive but what if he changes his IP or ~REDACTED~
-
vehiculos = { [1] = {modelo,x,y,z},--Rellenar los valores [2] = {modelo,x,y,z}--Rellenar los valores } for i, v in ipairs(vehiculos) do local modelo,x,y,z = unpack(v) local vehicle = createVehicle(modelo, x,y,z) setVehicleRespawnPosition(vehicle, x, y, z) end addEventHandler("onVehicleExplode", resourceRoot, function() respawnVehicle(source) end)
-
Why are you using cancelEvent in a command handler? cancelEvent is only for event. Try deleting that.