
DarkLink
Members-
Posts
610 -
Joined
-
Last visited
Everything posted by DarkLink
-
Ahhhhh!!! So I need always to clear a grid if I want to change a single value. I though it was possible to get which players died from the grid and only change their state column on the grid. Okay now I get it.. I need to change everything, not possible to change individual rows. Thanks bro.
-
Okay 0 is for infinite, thanks! didnt know Just one more question, here on ur code.. function refreshGridlist() for i, v in ipairs(getElementsByType('player')) do local row = guiGridListAddRow(gridList) guiGridListSetItemText(gridList, row, 1, getPlayerName(v), false, false) guiGridListSetItemText(gridList, row, 2, getPlayerState(v), false, false) end end This function will constantly add new lines (I mean rows..)..? And its suppose to changes the ones that are already made. I am not sure if u understand me Thanks!
-
Thanks for ur help guys, and how many times I will set the timer to repeat? I mean its suppose to refresh till the resource end So almost like infinite times..
-
indeed, he's a good mate. keep it up ! mta community always need people like u
-
yes thanks, that should help. but wasnt that my problem. after I get all the players dead, and all players alive. I need to change their string on state column, how do I get those players from the grid ? I need to get their row.. so I can set new text for them on state column did u understand my problem? thanks alot!
-
Okay guys I will take a look into these, thanks. Btw its hard to do custom models ? I mean for the light ?
-
Ok guys, I wanna do the following: Gridlist with column players (I already have), now I want another column with state of player, like dead or alive.. For example: On server I would trigger the event on player die, and changes his state on grid from alive to dead. right? but now here is my question: i need to get the row of that player, so then I can do "GuiGridListSetItemText" and changes the string to dead on respective column. So how I can get the row on the grid list of that player died ? Can I search for his name on all the gridlist ? and then get his row ? with some function? Thanks guys!
-
Ok thans bro, I will take a look Thanks all you can close guys .
-
Hm ok thanks, but I dont want to copy it
-
1, 2 and 3 OK, ty 4º Just need to see the element (playerd) glued at the heli bar, how do I get position of heli bar ? any function ? ty
-
Okay thanks for ur help. 1º Okay , I get it 2º How do I change weapon textures? Do I need some application ? 3º Dude let me try to explain, do u know police helicopters ? on single players they have a light that target u, when u are running from the cops, didnt u notice? I mean if its possible to sync that light, I mean the light of the heli that points to u. Did u understand? ty 4º okay thanks, that is for grabbing and for sit them on the iron bar so they could shoot with weapons, possible? some resource already made? ty
-
1º Change a weapon image on the HUD ? 2º Change a texture of a weapon? or at least color ? 3º Sync a light of the Heli of Cops ? 4º Glue a player on that iron bars of the heli , so he can be there shooting ? I dont want codes guys, I just wanna know if it is possible and how can I get it... with which functions? Thanks alot!
-
LOL! I discover it now that each function on lua files have a restriction of maybe 15 lines of code or so.. because I put more code in there today and didnt notice that the 'end' wasnt closing the function Now I delete some lines and 'end' is working on the function. Does this happen on lua functions ? can only have a few lines of code? thanks.
-
Noo! This is strange..
-
Okay guys, when I start my server now and joins, it doesnt do what was supposed to do.. Before, I had GUIs.. right at the event : onClientResourceStart Now that events arent triggering.. I didnt change anything at that place, I have no errors on console.. And I notice that its failing to connect to game-monitor when I try to run the server. I have all ports open, me and my friend can connect to the server. But its not doing things like was doing before.. The first things were the GUIs that appear right "onClientResourceStart". Thanks alot guys!
-
Yeah, I got a PM of him being really nice saying i always know whats right, and to answer his post... Well I looked ur posts and u know some shiits, so I though u could help me. But then I sadly realize you dont help much . So I gave up PMing u But its okay bro, no problem for me, I am okay. There are many good people here helping me
-
Hmm okay thanks alot. Btw how can I put color on string ? I have already seen on some examples, but didnt got it.. its something like #FF22FF .. its hexa code? 16 bits? Thanks.
-
Hey guys, on wiki I have these function which has these description: This function is for creating a new GUI label. A label is simply a piece of text that cannot be edited by the user. If you would like to have a bigger text you'd have to change its font because font size is not supported. So how do I set a bigger text ? how do I change the font? Without the DxDrawText..? Its possible? Thanks!
-
Ye bro, but I post right after my last post saying that I fixed it . And with fix solution But thanks for ur help!
-
ofc not, its not the full code here
-
Fixed! If anyone will have the same problem, I did these : on the client side , i changed the function triggerServerEvent to: triggerServerEvent("buttonClicked",getLocalPlayer(), equipa) and then on the joinHandler function, instead of client I changed to source. and its working
-
Thanks for ur reply Its there before the function, I just didnt copy to the show u guys. So I dont see where is the problem, I guess I am using tables like I should? and client info is being stored right? Sorry about the PM .
-
Okay look guys, I have been trying to do something, but its not working . So I have a gui on client side (ofc) players choose their team, and their client info will be saved, so later they will all spawn. I have these on client side when they choose team , I mean when they click the button of the team: client : function chooseTeam(button,state) -- if our login button was clicked with the left mouse button, and the state of the mouse button is up if button == "left" and state == "up" then -- move the input focus back onto the game (allowing players to move around, open the chatbox, etc) if source == btnIMI then equipa = "imigrante" else equipa = "police" end triggerServerEvent("buttonClicked", getRootElement(), equipa, client) guiSetInputEnabled(false) -- hide the window and all the components guiSetVisible(wdwLogin, false) -- hide the mouse cursor showCursor(false) end end and on the server side I have these: playersForIMI = {} playersForPOL = {} function joinHandler(equipa, client) if (gamemodeStarted == false) then if(equipa == 'imigrante') then table.insert(playersForIMI, client) else table.insert(playersForPOL, client) end end end addEventHandler("buttonClicked", root, joinHandler) okay the above codes will set the client info ( I mean the player ) on the table, to spawn next . and then the spawn functions, that will be called after the timer: on server side the timer: function countDown() segundos = segundos -1 for i,v in pairs(getElementsByType("player")) do setElementData(v,"secondsRemaining",tostring(segundos)) end if segundos <= 0 then triggerClientEvent ( "hideDX", getRootElement() ) timerEnabled = false setTimer(spawn, 50, 1, playersForIMI, playersForPOL) gamemodeStarted = true end end Like u see when timer go to 0, it will call the spawn function with both tables in arguments. So here it is, on server side too ofc: function spawn (playersForIMI, playersForPOL) team_policeSP = getTeamFromName("Police") team_immigrantsSP = getTeamFromName("Emigrants") local policeSPtable = getElementsByType('spawnpoint', team_policeSP) local immigrantsSPtable = getElementsByType('spawnpoint', team_immigrantsSP) local nr = math.random ( #policeSPtable ) local spawnPointPolice = policeSPtable[ nr ] nr = math.random ( #immigrantsSPtable ) local spawnPointImmigrants = immigrantsSPtable [ nr ] for i, v in ipairs(playersForIMI) do playersOnImmigrants = countPlayersInTeam ( team_immigrantsSP ) playersOnPolice = countPlayersInTeam ( team_policeSP ) if (playersOnImmigrants == playersOnPolice or playersOnImmigrants == playersOnPolice -1) then x, y, z = getElementPosition(spawnPointImmigrants) if setPlayerTeam" class="kw6">setPlayerTeam ( playersForIMI[i], team_immigrantsSP ) then outputChatBox("You are on immigrants team, ruun!", playersForIMI[i]) for i, v in ipairs(getPlayersInTeam(team_immigrantsSP)) do createBlipAttachedTo ( playersForIMI[i], 0, 3, 205, 133, 63, 255, 0, 99999.0, v) end playersOnImmigrants = countPlayersInTeam ( team_immigrantsSP ) playersOnPolice = countPlayersInTeam ( team_policeSP ) outputChatBox("Number of immigrants: " .. playersOnImmigrants, playersForIMI[i]) outputChatBox("Number of polices: " .. playersOnPolice, playersForIMI[i]) spawnPlayer(playersForIMI[i], x, y, z) fadeCamera(playersForIMI[i], true) setCameraTarget(playersForIMI[i], playersForIMI[i]) outputChatBox("Welcome to My Server", playersForIMI[i]) end else outputChatBox("Many players on team immigrants, the server will set you on the other team.", client) x, y, z = getElementPosition(spawnPointPolice) if setPlayerTeam" class="kw6">setPlayerTeam ( client, team_policeSP ) then outputChatBox("You are on police team, catch them!", client) for i, b in ipairs(getPlayersInTeam(team_policeSP)) do createBlipAttachedTo ( client, 0, 3, 0, 0, 255, 255, 0, 99999.0, b) end playersOnPolice = countPlayersInTeam ( team_policeSP ) playersOnImmigrants = countPlayersInTeam ( team_immigrantsSP ) outputChatBox("Number of immigrants: " .. playersOnImmigrants, client) outputChatBox("Number of police: " .. playersOnPolice, client) end end end No errors on console! but when the timer reach 0 , I keep with black screen.. no spawn for me.. Can anyone help me here? Thanks alot again.
-
Well I dont know Lua much yet, but you need an handler to call a function. If u just write a function on ur code, and u dont call it using and handler or a setTimer.. the function will not be called, its there, but dont do anything.. I guess thats how Lua on MTA
-
LOOOL!! I failed so much, a little thing like a space changes everything Thanks alot bro! Working ;D