h4x7o0r
Members-
Posts
203 -
Joined
-
Last visited
Everything posted by h4x7o0r
-
Now's working perfect. Thanks a lot TAPL. off: Your 5k post
-
Thanks for your reply TAPL. This code's working well. It does what i need but with a lil mistake. i'm using a button to save those settings, when i save settings if i have like 6 maps in the gridlist after that for loop i receive : those 6 maps + one blank row ( map 1 , map 2 ... map 6 , *BLANK )
-
that's just a part of a script. maps = guiCreateGridList(0.52, 0.04, 0.44, 0.7,true,tabMaps) guiGridListSetSelectionMode(maps,2) guiGridListAddColumn(maps,"Added maps",1) Thanks for your reply. Tried what u've suggested. at for loop Error : Table expected, got userdata.
-
Hey there, i'm having some issues with retrieving a list. So considering i'm having a gridlist (maps) populated with some maps. How can i insert that list to a table. LIke after the for loop to have tabel = { "maps1", "maps2") or something like this. I tried using something like this but it's not working Thanks in advance.
-
local x,y = guiGetScreenSize() -- resolution is e.g 800 x 600 etc. 'z' isn't used.
-
Have u successfully tested your local mysql database if it's well configured ? "share=0" for mysql databases anyways. Hope you have created "game" database on your server. U can also try : host=127.0.0.1 .
-
in destructionderby.lua search for those 2 functions (I assume you want this for a DM server) : DestructionDerby:onPlayerQuit(player) DestructionDerby:onPlayerWasted(player) Replace the following code in every single one: Default: if getActivePlayerCount() <= 1 then Change with : if getActivePlayerCount() <= 0 then
-
Thanks linkin, not working atm. Thanks xXMADEXx, your code's partially working like when I mute someone it's also muting me and by execute again the command does not unmuting. Thanks for your help guys.
-
Oh Thanks Bonsai for those guiding lines, tried something but i don't think will manage to do it myself. addEventHandler('onPlayerChat', root, function( message, messageType ) local tipu = getPlayerFromName ( source ) local echipa = getPlayerTeam (source) if isPlayerMuted (tipu) then if messageType == 0 then outputChatBox("You are muted on Public chat. You can still use TeamChat.",tipu) cancelEvent() elseif messageType == 2 then outputChatBox(": #FFFFFF"..message, echipa, red, green, blue, true ) end end end ) function mutePlayer(player,command,victimName) -- if the player has specified a victim name to mute if victimName then -- get the victim player element from their name local tipu = getPlayerFromName(victimName) -- if the player exists if tipu then -- if they arent already muted if ( not isPlayerMuted(tipu) ) then -- mute them and output a message to the chat setPlayerMuted(tipu, true) outputChatBox("You have been muted.",tipu) end else outputChatBox("Could not find player with name: "..tostring(victimName),player) end else outputChatBox("Usage: /pmute <player name>",player) end end addCommandHandler("pmute",mutePlayer) Any help is appreciated.
-
Hey there , i was wondering how can i mute a certain player from using only the public chat (lets say global) and as long as he's muted to let him use the teamchat ?
-
use in your default destruction_derby.lua (add those lines): function checkForHunter(number,sort,model) if #getElementsByType("player") <= 0 then return end local activePlayers = getActivePlayers() if #activePlayers == 1 then local vehicle = getPedOccupiedVehicle(activePlayers[1]) if getElementModel(vehicle) == 425 then setElementHealth(activePlayers[1],0) end end end and also, right after this comment line, overwrite all with the following chunk: -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 2 then triggerClientEvent ( "savetag3",getRootElement(),_getPlayerName(player)) end if #activePlayers == 1 then triggerClientEvent ( "savetag2",getRootElement(),_getPlayerName(player)) end if #activePlayers == 0 then self.rankingBoard:add(activePlayers[1], timePassed) triggerClientEvent ( "savetag",getRootElement(),_getPlayerName(player)) triggerEvent("peds",getRootElement()) --triggerEvent("onPlayerDestructionDerbyWin", getRootElement(), player) --saveDeathPlayer(activePlayers[1]) --addPodiumPlayer(activePlayers[1]) local timeravviato = false if timeravviato == false then setTimer (checkForHunter , 100, 0, player ) timeravviato = true end end if #activePlayers == 1 then --showMessage(getPlayerName(activePlayers[1]) .. ' pwned you all!', 171, 7, 7) triggerClientEvent ( "Winnertext", getRootElement(), activePlayers[1] ) triggerEvent("onPlayerDestructionDerbyWin", getRootElement(), activePlayers[1]) local car = getPedOccupiedVehicle(activePlayers[1]) if car then local model = getElementModel(car) if model == 425 then setElementHealth(activePlayers[1],0) end end end end
-
Thank you for your help, it's working well but i can't add the rest of the parameters. by default using the code provided before, if there are 2 teams already created it shows : 0 TEAM1 (2) 5 TEAM2 (2) 0 = teampoints TEAM1 = teamname (2) = alive players and so on . Using your code it shows only : TEAM1. How can i use the parameters as a string ? what i need is to use values from textTeam; textCount and textAlive.
-
Tried, not working. i've seen teams are stored here : textTeam ="".
-
i don't know how to retrieve team1 from addedteams -- wanna replace this textTeam(1) with the right syntax (tried : addedTeams[1] already but doesn't work) dxDrawText (textTeam(1), x - 175, (y/5.65)+13, x, y, tocolor(255, 255, 255, 255), 1.05, 'default-bold', "left", "top", false, false, false, true)
-
Hi there, here's part of the client side code. I wanna change the way that teams, alive players are shown. For example, the following code is working well but it's rendering those dxdraw's like this : Team1 Team5 What i want is to have 2 different dxDrawtext for every single team . Here's the client code: local funRound = true function onOffFunRound (state) funRound = state end function showCountTeams () if showTeams and addedTeams[2] then local textTeam = "" local textCount = "" local textAlives = "" if funRound then --dxDrawRectangle ( 0, 0, x, y , tocolor (0, 0, 0, 50)) dxDrawText("Free Round", x - 141, (y/5.65)-14, x, y, tocolor(255, 0, 0, 255), 1.3, 'default-bold') end for i, team in ipairs (addedTeams) do textCount = textCount..countTable[getTeamName(team)].."\n" if alivept[getTeamName(team)] and not funRound then textAlives = " ("..alivept[getTeamName(team)]..")" end textTeam = textTeam..string.format("#%.2X%.2X%.2X", getTeamColor(team))..getTeamName(team)..textAlives.."\n" end dxDrawRectangle ( x - 190, (y/5.65)-14, 200, (20+14*#addedTeams) , tocolor ( 0, 0, 0, 50 ) ) dxDrawRectangle ( x - 190, y/5.5, 200, (20+14*#addedTeams) , tocolor ( 0, 0, 0, 150 ) ) dxDrawText(textCount, x - 185, (y/5.65)+13, x, y, tocolor(255, 255, 255, 255), 1.05, 'default-bold') dxDrawText (textTeam, x - 175, (y/5.65)+13, x, y, tocolor(255, 255, 255, 255), 1.05, 'default-bold', "left", "top", false, false, false, true) end end addEventHandler ( "onClientRender", root, showCountTeams ) I don't really know how to trigger those teams -- Something like this dxDrawText (textTeam(1), x - 175, (y/5.65)+13, x, y, tocolor(255, 255, 255, 255), 1.05, 'default-bold', "left", "top", false, false, false, true) dxDrawText (textTeam(2), x - 375, (y/5.65)+13, x, y, tocolor(255, 255, 255, 255), 1.05, 'default-bold', "left", "top", false, false, false, true)
-
Solved. Thank you all for your help.
-
I mean, spoiler's not on the car after script's starting. Does nothing.
-
GuiGridListSetSortingEnabled
-
thanks for your reply but doesn't work. No errors. I want it that everytime a vehicle got changed to apply the vehicle upgrade.
-
function checkveh (veh) for _, v in ipairs(getElementsByType("vehicle")) do if getElementModel (v) == 415 then if not getVehicleUpgradeOnSlot(v, 2) then addVehicleUpgrade ( v, 1003 ) end end end end addEventHandler("onResourceStart",getRootElement(),checkveh) No errors but doesn't work. No change. Thanks for reply.
-
Thanks for ur reply. function checkveh (veh) for _, v in ipairs(getElementsByType("vehicle")) do if getElementModel (vehicle) == 415 then if not getVehicleUpgradeOnSlot(vehicle, 2) then addVehicleUpgrade ( vehicle, 1003 ) end end end end addEventHandler("onResourceStart",getRootElement(),checkveh)
-
Hey guys, I tried to find a way when i start a resource to add some vehicle upgrades to some cars. For example. When resource is started, to set default Spoiler id 1003 for car id 415. How can i manage to make it ? Thank in advance.
-
tnx but i don't know if it's the best. For example, those r,g,b are the colors of the first team i think i need another table to save em properly. And i can't use that table [team}. As i said before, i'm using another resource to set up autoteams. so the teams are already created. I just need to get teamname and teamcolor for the 2 teams that are already created and use them to the script.