
DarkLink
Members-
Posts
610 -
Joined
-
Last visited
Everything posted by DarkLink
-
And a client alive is different of a player alive right? might be the problem.. dont know much too about it. Just there is some kinda of problem with it, or wiki tells bad information, might do another thing.. not what is on wiki! I will report it on that bug tracker, thanks
-
Hmm I get it, thanks for explaining me qaisjp By the way guys, dont know if u are following/waiting this alot or not.. but I might say that today was a good day for the development of this. I fixed alot of bugs that couldnt fix before, and while I progress I get experience, things get easier, and I start to fix things that were very silly and bad scripted. So here it is today work, 13-07-2011 I wanna thank jacob, castillo that are always helping me! It has been enormously helpful till today! Wanna finish this as fast as possible, I have another gamemode on mind :b
-
Hm okay thanks bro, since u are MLM can u report bugs to mta team? This is important to all scripters, I guess Dont wanna more scripters losing their time like me, when they dont know where the problem comes from Thanks castillo
-
Guys found the problem, changed from if not isPlayerDead(v) then table.insert(theTable, v) end to if getElementHealth(v) ~= 0 then table.insert(theTable, v) end Guys its not the first time I found a function not working like the wiki says.. We need more testeres reporting this, I dont know how to report bugs, but look if someone knows, just report this bug to the mta team!! isPlayerDead was not working on client properly! THANKS alot castillo and jacob
-
Didnt worked too.. On client that die its all fine, but now I notice that on other client it go 0 - 1, but right on next second it goes back to 1 - 1, and other client is still dead.. this is very strange Thanks in advance guys!
-
Thanks for ur help, but still not working here. The gui just change the numbers on client that die, I cant understand this baah In my mind there is no problem here.. but might be, its not working perfect .. Thanks guys EDIT: Found these errors on clientscript: [2011-07-12 23:11:30] WARNING: borderpatrol\client_logingui.lua:194: Bad argument @ 'getPlayersInTeam' [2011-07-12 23:11:30] ERROR: borderpatrol\client_logingui.lua:195: bad argument #1 to 'pairs' (table expected, got boolean) its the lines on the function getAlivePlayersInTeam : local players = getPlayersInTeam(theTeam) for i,v in pairs(players) do
-
Okay guys, I made a gui to count players alive on each team. But it just refresh for the player that dies I cant get what is wrong Here is my code: server-side: setTimer(triggerClientEvent, 1000, 1, "colocarNrJogadores", root, team_immigrantsSP, team_policeSP) -- that optional arguments are variables with teams. players are already set on them, before this timer. client-side: X = 0.65 Y = 0.055 Width = 0.1 Height = 0.1 numbersOfPlayersTeam = guiCreateWindow(X, Y, Width, Height, "EMI vs POL", true) guiWindowSetMovable( numbersOfPlayersTeam, false) guiWindowSetSizable( numbersOfPlayersTeam, false) guiSetVisible(numbersOfPlayersTeam, false) nrAliveEMI = guiCreateLabel ( 0.23, 0.34, 0.5, 1, "0", true, numbersOfPlayersTeam ) nrAlivePOL = guiCreateLabel ( 0.64, 0.34, 0.5, 1, "0", true, numbersOfPlayersTeam ) guiSetFont ( nrAliveEMI, "sa-header" ) guiSetFont ( nrAlivePOL,"sa-header" ) guiLabelSetColor ( nrAliveEMI, 205, 133, 63 ) guiLabelSetColor ( nrAlivePOL, 0, 0, 255 ) addEvent("colocarNrJogadores",true) function colocarJogadoresNoGUI(team_immigrantsSP, team_policeSP) setTimer(function(team_immigrantsSP, team_policeSP) local nr1, nr2 = getPlayersInTeam(team_immigrantsSP), getPlayersInTeam(team_policeSP) colocarNrAliveNoGUI(nr1,nr2) end, 1000,0, team_immigrantsSP, team_policeSP) end addEventHandler("colocarNrJogadores", getRootElement(), colocarJogadoresNoGUI) function colocarNrAliveNoGUI(nr1, nr2) local qtd = 0 for i, v in ipairs (nr1) do if(not isPlayerDead(v)) then qtd = qtd + 1 end end guiSetText ( nrAliveEMI, tostring(qtd) ) qtd = 0 for i, k in ipairs (nr2) do if(not isPlayerDead(k)) then qtd = qtd +1 end end guiSetText ( nrAlivePOL, tostring(qtd) ) end Thanks in advance, I hope someone finds the problem EDIT: if u guys dont understand, the problem is, on start there are 1 - 1 on gui (one player on each team) when a player dies his GUI changes to 0 - 1, but on the other client it stays 1 - 1, cant understand why? thanks!!
-
Thanks bro. Well I dont need to check speed, and also dont need destroyElement x) And yes I used a static object.
-
setTimer(guiProgressBarSetProgress,100, 20, progressHUD, guiProgressBarGetProgress(progressHUD) + 5) Should work
-
Yes ofc bro, I just forgot the barrels, it were all bugged and problems with sync between clients and server after explode. I just made my own mines using createExplosion, much better
-
Okay just to let u guys know, I made alot this last few days.
-
Yes it fixed! Thanks alot bro ;D
-
Okay I have one question here, when someone hit those explosive barrels, they explode for the server right? I mean it gets exploded for all the clients. And then it will respawn for all the clients or just for the one that explode it ? Its there a way to control this? Thanks. EDDDIT: FIXED! Thanks anyway guys
-
Bro it doesnt trigger! This is bad for mta I tryed killing a player without headshot, and all went ok. but when I make headshot, it will kill ped with function killPlayer. And then the player get killed, but the event onPlayerWasted doesnt get triggered How to solve this? Thanks.
-
Maybe when I use killPed(source), the event onPlayerWasted dont trigger ? oO Thanks
-
Thanks for ur reply castillo, but I cant see outputChatBox("hei2"), and the changes u do its after that Wont work anyway, right? And I used alot times getPlayerTeam() and it works, any problem with that function? or? Thanks bro.
-
Hm okay , thanks guys. 92% its almost done then ;D Waiting guys.. dont give up :b
-
Okay guys, here I am again .. I have this code: server side function playerKilled(ammo, attacker, weapon, bodypart) outputChatBox("hei") if(attacker ~= false) then outputChatBox("hei2") if(getPlayerTeam(source) == team_immigrantsSP) then outputChatBox("hei3") if(getPlayerTeam(attacker) == team_policeSP) then outputChatBox("hei4") if(getElementData(source, "canBeKilled", false) == 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 ) The problem is: when I headshot a emigrant (I am police) he dies, but on function playerKilled, I just see the "heei" on chatbox, not "heei2" .. not "heei3".. not "heei4" . why the well ? The condition is, if attacker exists I mean, the emigrant is killed by him, not by fall.. or something else.. But it dont go throuh that condition Can someone help me? thanks.
-
Well I could do it. but I made all the script in this way. when a game ends, the resource is stoped. and then someone starts it again. Thanks jacob
-
Hmm thanks, I see the advantages of using such system But what is compiling ? and why not using on google code? .. we are going a bit off-topic, just answer me, and lets finish this subject x)
-
Thanks for ur help, I fixed the problem. but that is a good solution, to see when client had started the resource thanks bro
-
I dont if it was or not, but I will ask it anyway So... when 1.1 is released ? Any clues..? dates..? previsions..? Thanks in advance , mta = best mod ever made . just saying ....
-
Guys I fixed this, changing the onStart function, added the remove handler if there were more than 2 players Thanks anyway!!
-
Posts are just posts, you must not rely on them, but thanks for your opinion. I have readed something about projects on code google, and its a good thing to have if there are a big team working on a big project. But I am alone in this, besides the ones here in the forum that keep helping me. But I do the code, so I guess dont need an online server to store files like code google does, right? it will just delay the project. Thanks!
-
Yes I guess , is there some function to see if players have already download resources then dont trigger onClientResourceStart but onResourceStart instead. client side addEventHandler("onClientResourceStart", getRootElement(getThisResource()), function() outputChatBox("Welcome to my server bro! This is only for Borderpatrol gamemode! ENJOY") triggerServerEvent("checkTwoPlayersOnMode", getLocalPlayer()) end) So when the resource stops (reach the end) I will make it to start again, and when I test this, this event is triggered * (players on server). And the event "checkTwoPlayersOnMode" will be trigger a big amout of times (depending on players online) server side segundos = 30 timerEnabled = false gamemodeStarted = false addEvent("checkTwoPlayersOnMode", true) function checkTwoAndNotStartedRunIT () if gamemodeStarted == false then if timerEnabled == false then if(getPlayerCount() >= 2) then setTimer(escreve, 200, 1) triggerClientEvent("canShowGUISPAWN",getRootElement()) else outputChatBox("NOTE: This gamemode need at least 2 players online to start!", source) end else setElementData(source,"secondsRemaining",tostring(segundos)) triggerClientEvent ( source, "showDX", source ) triggerClientEvent(source,"canShowGUISPAWN",source) end else outputChatBox("You will need to wait the gamemode to finish, sorry", source) end end addEventHandler("checkTwoPlayersOnMode", getRootElement(), checkTwoAndNotStartedRunIT) function escreve () timerEnabled = true for i,v in pairs(getElementsByType("player")) do setElementData(v,"secondsRemaining",tostring(segundos)) triggerClientEvent ( v, "showDX", v ) end setTimer(countDown,1000,30) end function countDown() segundos = segundos -1 for i,v in pairs(getElementsByType("player")) do setElementData(v,"secondsRemaining",tostring(segundos)) end if segundos == 3 then triggerClientEvent("hadChosenTeam", getRootElement()) end if segundos == 0 then triggerClientEvent ( "hideDX", getRootElement() ) triggerClientEvent("hideSpawnGUI", getRootElement()) timerEnabled = false gamemodeStarted = true if(#playersForIMI==#playersForPOL or #playersForIMI == #playersForIMI + 1 or #playersForPOL == #playersForIMI + 1) then spawn() else outputChatBox("---Gamemode will run auto-balance---", getRootElement(), 255, 64, 64) autobalance() end end end function onStart () timerEnabled = false if(getPlayerCount() >= 2) then setTimer(escreve, 1500, 1) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart ) And this is the function that will call the timer to start writing on all the clients, its working on the first time they join server, but if I restart and there are players on, the timer gets bugged because this event its called x amount of times, and the segundos get decrease - 2/-3/-4 (depending on players online) instead of -1 . Did you guys understand? Thanks in advance, this is a major bug that I dont know how to fix it Thanks.