-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I would suggest reading about the function before suggesting, this function is server-side only, his script is client-side, my original function to find alive players used isPedDead because it was server-side. https://wiki.multitheftauto.com/wiki/IsPedDead
-
Try with this: -- Teams function Tro() dxDrawImage(316.0,241.0,129.0,114.0,"tropas.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText("Tropas",327.0,175.0,427.0,231.0,tocolor(255,255,255,255),2.0,"default","center","center",false,false,false) end addEvent("Tpas",true) addEventHandler("Tpas", getRootElement(), function() addEventHandler("onClientRender",root, Tro) setTimer (function () removeEventHandler("onClientRender",root, Tro) end ,13000, 1 ) end) function Snaz() dxDrawImage(325.0,231.0,103.0,99.0,"spetsnaz.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText("Spetsnaz",327.0,175.0,427.0,231.0,tocolor(255,255,255,255),2.0,"default","center","center",false,false,false) end addEvent("Spets",true) addEventHandler("Spets", getRootElement(), function() addEventHandler("onClientRender",root, Snaz) setTimer (function () removeEventHandler("onClientRender",root, Snaz) end ,13000, 1 ) end) function P40() dxDrawImage(318.0,231.0,134.0,122.0,"op40.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText("OP40",327.0,175.0,427.0,231.0,tocolor(255,255,255,255),3.0,"default","center","center",false,false,false) end addEvent("O40",true) addEventHandler("O40", getRootElement(), function() addEventHandler("onClientRender",root, P40) setTimer (function () removeEventHandler("onClientRender",root, P40) end ,13000, 1 ) end) function OPS() dxDrawImage(309.0,231.0,134.0,121.0,"black ops.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText("Black OPS",327.0,175.0,427.0,231.0,tocolor(255,255,255,255),3.0,"default","center","center",false,false,false) end addEvent("BOPS",true) addEventHandler("BOPS", getRootElement(), function() addEventHandler("onClientRender",root, OPS) setTimer (function () removeEventHandler("onClientRender",root, OPS) end ,13000, 1 ) end) function nva() dxDrawText("NVA",327.0,175.0,427.0,231.0,tocolor(255,255,255,255),4.0,"default","center","center",false,false,false) dxDrawImage(312.0,227.0,127.0,143.0,"nva.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) end addEvent("NVA",true) addEventHandler("NVA", getRootElement(), function() addEventHandler("onClientRender",root, nva) setTimer (function () removeEventHandler("onClientRender",root, nva) end ,13000, 1 ) end)
-
You'll need some scripting knowledge to achieve this, I would suggest you (if you are new to scripting) to try with something easier first.
-
Maybe your game mode is messing with this?
-
function nametagColorChange ( thePlayer, commandName, r, g, b ) -- Apply the new color mix of RGB to the command handler activator setPlayerNametagColor ( thePlayer, tonumber(r), tonumber(g), tonumber(b) ) end -- This is a command handler that activates on text "nametagcolor" in the console. It also asks -- the player to provide values for the extra parameters r, g, b after the command name. These will -- be the new color mix of RGB to apply to the player's name tag. addCommandHandler ( "nametagcolor", nametagColorChange ) Try that.
-
Maybe that function is designed to check if the client is alive? P.S: Everyone can report bugs, just head to the bug tracker and report it.
-
I was going to suggest you to use that, but I never used isPlayerDead before so I didn't know about that function. P.S: No problem .
-
Use this custom function: addEvent("colocarNrJogadores",true) function colocarJogadoresNoGUI(team_immigrantsSP, team_policeSP) setTimer(function(team_immigrantsSP, team_policeSP) colocarNrAliveNoGUI(team_immigrantsSP,team_policeSP) end, 1000,0, team_immigrantsSP, team_policeSP) end addEventHandler("colocarNrJogadores", getRootElement(), colocarJogadoresNoGUI) function colocarNrAliveNoGUI(team1, team2) local qtd = #getAlivePlayersInTeam(team1) or 0 guiSetText ( nrAliveEMI, tostring(qtd) ) local qtd2 = #getAlivePlayersInTeam(team2) or 0 guiSetText ( nrAlivePOL, tostring(qtd2) ) end function getAlivePlayersInTeam(theTeam) local theTable = { } local players = getPlayersInTeam(theTeam) for i,v in pairs(players) do if not isPlayerDead(v) then theTable[#theTable+1]=v end end return theTable end I tested it and works fine.
-
Go to race resource and open the file race_server.lua then search for this: exports.scoreboard:addScoreboardColumn('checkpoint') and delete the line or comment it with "--" in the line.
-
No if i'm right. Btw, why would you compile a MAP...? is server side, nobody can steal it if they doesn't has access to the server files.
-
onClientGUIClick is a EVENT handler, not a function. https://wiki.multitheftauto.com/wiki/Cli ... GUI_events
-
omfg maskatchi! have you even bothered on checking last post date?????? is from the 2008! I haven't seen Ace_Gambit around here anymore, maybe he left.
-
Such a lazy guy isn't he? He could have found out how to toggle cursor off if he used the wiki.
-
Do you know what debugscript is? well, if you don't then go in-game and type /debugscript 3 and see if there's any error.
-
You had many errors here... try with this: -- Created: 02/07/2011 09:45 addEventHandler("onClientResourceStart",resourceRoot, function() guiEditor_Memo = {} guiEditor_Label = {} guiEditor_Image = {} guiFgWelcomeWindow = guiCreateWindow(77,262,1279,1023," R U L E S ! ",false) guiSetAlpha(GUIFgWelcomeWindow,1) guiWindowSetSizable(GUIFgWelcomeWindow,false) guiFgOkButton = guiCreateButton(564,943,172,59,"O K ! ",false,GUIFgWelcomeWindow) guiSetAlpha(GUIFgOkButton,1) guiSetFont(GUIFgOkButton,"clear-normal") guiFgImage = guiCreateStaticImage(9,21,1261,333,"images/FGOfficialLogo.png",false,GUIFgWelcomeWindow) guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,GUIFgWelcomeWindow) guiSetAlpha(GUIEditor_Label[1],1) guiLabelSetColor(GUIEditor_Label[1],0, 155 ,155) guiSetFont(GUIEditor_Label[1],"clear-normal") guiFgRulesMemo = guiCreateMemo(2,5,1265,565," [FG] Rules !\n\n\n\n\n\n**********************************************************************************************************************************************************************************\n T H I S I S A F R E E R O A M !!!\n\n*DO NOT ADVERTISE !\n\n\n*DO NOT SPAM THE CHAT !\n\n\n*DO NO SPAM VEHICLES ! \n\n\n*DO NOT BE ANNOYING !\n\n\n*BE NICE, RESPECT OTHERS !\n\n\n*DO NOT USE HACKS, CHEATS OR HANDLING CFG !\n\n\n***************************************************************\n\nAbove all, Have fun ! \n\n",false,GUIEditor_Label[1]) guiMemoSetReadOnly(GUIFgRulesMemo,true) guiEditor_Image[1] = guiCreateStaticImage(19,953,91,56,"images/shruk.png",false,GUIFgWelcomeWindow) guiFgCheckBox = guiCreateCheckBox(398,940,343,72,"",false,false,GUIFgWelcomeWindow) guiCheckBoxSetSelected(GUIFgCheckBox,true) guiEditor_Memo[1] = guiCreateMemo(15,3,148,37,"I accept these Rules ! ",false,GUIFgCheckBox) addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) end, false) end ) P.S: Use the LUA tags next time.
-
Correction: wtf is wrong with server owners *
-
I don't understand you either... createPickup returns a pickup element already.
-
Well, maybe use setElementHealth(source,0) instead of killPed() ?
-
Yes, it triggers when a player dies. Btw, you changed team names in getTeamFromName? Edit: You want to check if the player team is imigrants (example team name) or police? if so use this: function playerKilled(ammo, attacker, weapon, bodypart) outputChatBox("hei") if(attacker ~= false) then outputChatBox("hei2") if(getPlayerTeam(source) == getTeamFromName("IMIGRANTS OR WHATEVER TEAM NAME")) then outputChatBox("hei3") elseif(getPlayerTeam(attacker) == getTeamFromName("POLICE TEAM NAME")) then outputChatBox("hei4") end if(getElementData(source, "canBeKilled") == false) then outputChatBox("hei5") setElementInterior(attacker, prisonForPolice) setTimer(setElementPosition, 500, 1, attacker, xP, yP, zP + 1) end end end addEventHandler ("onPlayerWasted", getRootElement(), playerKilled)
-
function playerKilled(ammo, attacker, weapon, bodypart) outputChatBox("hei") if(attacker ~= false) then outputChatBox("hei2") if(getPlayerTeam(source) == getTeamFromName("IMIGRANTS OR WHATEVER TEAM NAME")) then outputChatBox("hei3") if(getPlayerTeam(attacker) == getTeamFromName("POLICE TEAM NAME")) then outputChatBox("hei4") if(getElementData(source, "canBeKilled") == false) then outputChatBox("hei5") setElementInterior(attacker, prisonForPolice) setTimer(setElementPosition, 500, 1, attacker, xP, yP, zP + 1) end end end end end addEventHandler ("onPlayerWasted", getRootElement(), playerKilled) function playerDamage_text ( attacker, weapon, bodypart, loss ) if ( bodypart == 9 ) then killPed(source) end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text ) Set your team names in getTeamFromName and see if it works that way.
-
Lol, this is the most funny I seen around here... ingame money? is that a joke? Most of the good scripters are all busy with their own projects already, if you don't offer REAL money, you won't get any. But... who knows, good luck.
-
I tested the code I gave you and works fine. Note: This will work if someone kills you, not when you die with some command.
