DarkLink
Members-
Posts
610 -
Joined
-
Last visited
Everything posted by DarkLink
-
alphabetical? omfg that kinda sucks But ok thanks I got it And the other situation, I am trying to do something like. The user places a passage with type inside which name will be "teleport_one" and then need to place another passage with type outside and with same name, "teleport_one". And then the script will get the passage with name "teleport_one", and make each function for inside and outside, inside will teleport to outside and outside will teleport to inside, of this "teleport_one". you get it? I think its friendly, just need to tell on instructions that mappers should place a inside and outside passage to make it work. I just dont know if its possible to set elements with same name (ID) on map editor, didnt had time yet to test, but I think its possible. By the way Wojak thanks alot for your help, and if u know something better to implement this and more user friendly, please tell me. Thanks bro.
-
By the way guys, I have another problem. I want to add a data node to a custom element, like a selection tab. When people want to create a teleport, they need to specify which area, if it is outside usa or inside usa. you see? I mean something like this: area="selection:outside,inside" on the edf, but I dont know how to make it good, I am getting some problem on map editor, and I cant even see the custom elements now, when I try this area data node.. So how can I implement this? Then on my scripts I want to get all the teleports, and do function A for inside teleports and do function B for outside teleports. I think you get it. Thanks guys
-
Hey guys just one more question! I found out that doesnt make difference the order I write the elements on my edf file.. The order of custom elements will always be from the ones with less code to the others with more code? right? I tryed this two ways: <def name="borderpatrol"> <element name="mine" friendlyname="Mine" instructions="Place your mine wherever you want, police need do defend USA!" icon="mine.png" > <object editorOnly="true" model="3053" posZ="0" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="rotation" type="coord3d" default="0,0,0" /> </element> <element name="spawnpoint" friendlyname="Spawnpoint" instructions="Place your spawnspoints!" icon="spawnpoint.png"> <data name="team" type="selection:Emigrants,Police" required="true" default="Emigrants" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="rotation" type="coord3d" default="0,0,0" /> <data name="skin" type="skinID" default="0" /> <ped model="!skin!" rotation="!rotation!" position="!position!" team="!team!"/> </element> </def> <def name="borderpatrol"> <element name="spawnpoint" friendlyname="Spawnpoint" instructions="Place your spawnspoints!" icon="spawnpoint.png"> <data name="team" type="selection:Emigrants,Police" required="true" default="Emigrants" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="rotation" type="coord3d" default="0,0,0" /> <data name="skin" type="skinID" default="0" /> <ped model="!skin!" rotation="!rotation!" position="!position!" team="!team!"/> </element> <element name="mine" friendlyname="Mine" instructions="Place your mine wherever you want, police need do defend USA!" icon="mine.png" > <object editorOnly="true" model="3053" posZ="0" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="rotation" type="coord3d" default="0,0,0" /> </element> </def> And its the same, I always get mine as the first custom object and then the spawnpoint as the second? So can someone tell me how to control the order of this custom elements on map editor? Thanks in Advance!
-
Hmmm I see! Thanks alot Jacob Thanks SDK The mod can close .
-
Hmmm thanks for ur reply SDK, so If I want to control all the mines on my gamemode. What I need to do is: getElementsByType('mine') so I get all the mines, right? and then I create a object for each element right? with the position and rotation I get from getElementData right? Then If I want to control all these objects (all the mines), I can easly put all the objects (mines) on a table? right? And I make what I want for all the objects on that table, right? I guess I understand, thanks SDK!
-
Okay guys, I made some custom elements for my gamemode and I am trying to load them on my script, but I guess its not getting it like an object, cant see object playing my map. So first I have my edf file here: <def name="borderpatrol"> <element name="mine" friendlyname="Mine" instructions="Place your mine wherever you want, police need do defend USA!" icon="mine.png" > <object editorOnly="true" model="3053" posZ="0" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="rotation" type="coord3d" default="0,0,0" /> </element> </def> Then My map here: <map edf:definitions="borderpatrol,editor_main"> <mine id="mine1" posX="177.49530029297" posY="2518.6298828125" posZ="15.657386779785" rotX="0" rotY="0" rotZ="0" /> <mine id="mine2" posX="177.57591247559" posY="2522.3798828125" posZ="15.732385635376" rotX="0" rotY="0" rotZ="0" /> <mine id="mine3" posX="177.66137695313" posY="2526.3798828125" posZ="15.782384872437" rotX="0" rotY="0" rotZ="0" /> <mine id="mine4" posX="177.37162780762" posY="2510.9431152344" posZ="15.50737285614" rotX="0.25" rotY="0" rotZ="0" /> </map> I am using on my map file definitions editor_main too, dont know if its messing or not, but I think I need it to load the objects? Thanks guys, I dont know much about defitions, but I guess u can help me. Thanks
-
Thanks for ur reply, u say a typo in meta.xml ? What do you mean bro? Thanks. EDIT: Found the problem bro! Ehehe thanks alot!
-
Okay guys, I made the EDF for my gamemode, and it was working before, I could go map editor and add the definitions settings there.. but now, I go there and I dont see the definition settings for my gamemode I think all its okay.. the meta.xml is like this: <meta> <info author="Tiago Martins" version="0.1" type="gamemode" name="DarkLink" description="A gamemode about border patrol and emigration" edf:definition="borderpatrol.edf"/> <script src="server_onPlayerJoin.lua" type="server" /> <script src="server_lightsnmines.lua" type="server" /> <script src="server_radarZone.lua" type="server" /> <script src="client_logingui.lua" type="client" /> <script src="server_Weapons.lua" type="server" /> <script src="client_WeaponsFunc.lua" type="client" /> <script src="server_Prisao.lua" type="server" /> <script src="server_passagens.lua" type="server" /> <script src="client_mines.lua" type="client" /> <script src="client_weed.lua" type="client" /> <script src="server_weed.lua" type="server" /> <map src="teleporte.map" dimension="0" /> <file src="spawnpoint.png" /> <file src="flag.png" /> <file src="team.png" /> <file src="weapon.png" /> </meta> the borderpatrol.edf file: <def name="borderpatrol"> <element name="spawnpoint" friendlyname="Spawnpoint" instructions="Place your spawnspoints!" icon="spawnpoint.png"> <data name="team" type="selection:Emigrants,Police" required="true" default="Emigrants" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="rotation" type="coord3d" default="0,0,0" /> <data name="skin" type="skinID" default="0" /> <ped model="!skin!" rotation="!rotation!" position="!position!" team="!team!"/> </element> <element name="passage" friendlyname="Teleport" instructions="Place your teleport, emigrants need to reach USA!" icon="teleport.png" > <data name="position" type="coord3d" default="0,0,0" /> <data name="size" type="number" required="false" default="2"/> <data name="color" type="color" required="false" default="##0ff94dff" /> <marker type="cylinder" size="!size!" color="!color!" /> <marker size="0.5" type="cylinder" color="#ffff00ff" /> </element> <element name="mine" friendlyname="Mine" instructions="Place your mine wherever you want, police need do defend USA!" icon="mine.png" > <object editorOnly="true" model="3053" posZ="0" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="rotation" type="coord3d" default="0,0,0" /> </element> </def> And my resource folder: Thanks in advance guys, It was working one hour before!! But know, I tryed to put it on a folder named edf inside my resource folder, and changing the directory on meta.xml file and such... and didnt worked, then I put again on resource folder, but cant see the settings now on map editor Thanks.
-
Didnt work, I guess I will give up, not possible Thanks all anyway.
-
Fixed thanks guys!!
-
lol its so much jacob 400 lines lol the command handler is the function called by onplayerjoin event local skinsForEMI = {183,158,159,160,162,132,136} addEvent("buttonClicked",true) gamemodeStarted = false playersForIMI = {} playersForPOL = {} function setcolor(playerSource) outputChatBox("cona") setPlayerNametagColor(playerSource, 255, 10, 40) end function joinHandler(equipa) if (gamemodeStarted == false) then if(equipa == 'imigrante') then table.insert(playersForIMI, source) --setPlayerNametagColor(source, tonumber(205), tonumber(133), tonumber(63)) elseif(equipa == 'police') then table.insert(playersForPOL, source) --setPlayerNametagColor(source, 30, 144, 255) else local numberOfTeam = math.random(2) if numberOfTeam == 1 then table.insert(playersForIMI, source) else table.insert(playersForPOL, source) end end end end addEventHandler("buttonClicked", root, joinHandler) function playerJoin () local name = getPlayerName(source) for i, v in ipairs(getElementsByType("player")) do if (v ~= source) then outputChatBox("[" .. name .. "] has joined the server", v, 255, 64, 64) addCommandHandler("nametagcolor", setcolor) end end end addEventHandler ( "onPlayerJoin", getRootElement(), playerJoin ) function destroyBlipsWhenPlayerLeavesServer ( quitType) local name = getPlayerName(source) outputChatBox("[" .. name .. "] has left the server [" .. quitType .."]", getRootElement(), 255, 64, 64) if source then local attacheds = getAttachedElements ( source ) if ( attacheds ) then for k,element in ipairs(attacheds) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end end addEventHandler ( "onPlayerQuit", getRootElement(), destroyBlipsWhenPlayerLeavesServer ) function colocarDeNoite () setTime ( 1, 0) --setWeather ( 22 ) end addEventHandler ( "onResourceStart", getRootElement(), colocarDeNoite) segundos = 30 timerEnabled = false gamemodeStarted = false local mostrou = false addEvent("checkTwoPlayersOnMode", true) function checkTwoAndNotStartedRunIT () if gamemodeStarted == false then if timerEnabled == false then if(getPlayerCount() >= 1) then setTimer(escreve, 200, 1) triggerClientEvent("canShowGUISPAWN",getRootElement()) mostrou = true 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 ) if(mostrou ~= true) then triggerClientEvent(v,"canShowGUISPAWN",v) end 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 == #playersForPOL + 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 removeEventHandler ("checkTwoPlayersOnMode", getRootElement(), checkTwoAndNotStartedRunIT ) setTimer(escreve, 1500, 1) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart ) function autobalance() if(#playersForIMI - #playersForPOL >= 2) then local sync = false local dif = #playersForIMI - #playersForPOL if(dif % 2 == 0) then while(sync ~= true) do if(#playersForIMI ~= #playersForPOL) then table.insert(playersForPOL, playersForIMI[#playersForIMI]) table.remove(playersForIMI, #playersForIMI) setPlayerTeam ( playersForPOL[#playersForPOL], team_policeSP ) outputChatBox(">>Auto-balance system changed your team!", playersForPOL[#playersForPOL], 255, 64, 64) else sync = true end end spawn() else while(sync ~= true) do if(#playersForIMI ~= #playersForPOL + 1) then table.insert(playersForPOL, playersForIMI[#playersForIMI]) table.remove(playersForIMI, #playersForIMI) setPlayerTeam ( playersForPOL[#playersForPOL], team_policeSP ) outputChatBox(">>Auto-balance system changed your team!", playersForPOL[#playersForPOL], 255, 64, 64) else sync = true end end spawn() end elseif(#playersForPOL - #playersForIMI >= 2) then local sync = false local dif = #playersForPOL - #playersForIMI if(dif % 2 == 0) then while(sync ~= true) do if(#playersForPOL ~= #playersForIMI) then table.insert(playersForIMI, playersForPOL[#playersForPOL]) table.remove(playersForPOL, #playersForPOL) setPlayerTeam ( playersForIMI[#playersForIMI], team_immigrantsSP ) outputChatBox(">>Auto-balance system changed your team!", playersForIMI[#playersForIMI], 255, 64, 64) else sync = true end end spawn() else while(sync ~= true) do if(#playersForPOL ~= #playersForIMI + 1) then
-
Really? But all the files that I use for the resource? They are already many If you have any guess of which problems can make this function not to work, I can search on the script. Thanks jacob
-
Guys I have problem here with timer Tryed setTimer(estaPertoActivaMines, 1000,0) , no error but didnt saw the mines Thanks, I am getting a bit tired, I always have problems, cant write something and put it work on 1st time setTimer(estaPertoActivaMines(),1000,0) function estaPertoActivaMines() local player = getLocalPlayer() if(getPedOccupiedVehicle(player) ~= false) then local vehicle = getPedOccupiedVehicle(player) if(getElementData(vehicle, 'lighton', false) == true) then for i, v in ipairs(getElementsByType('object')) do local x, y, z = getElementPosition(getLocalPlayer()) local x1, y1, z1 = getElementPosition(v) if getElementModel(v) == 3053 then if(getDistanceBetweenPoints3D ( x, y, z, x1, y1, z1 ) <= -- s8) --> then setElementDimension(v,0) end setObjectStatic(v, true) end end end end end
-
didnt work bro, I tested on another resource and the function is working perfect.. I dont know where is the problem when I add it to my script What might block this function? do you know? thanks.
-
Can't help more than Solidsnake did. This should work and if it doesn't then something is wrong elsewhere in your script. Hm thanks bro. When a color is setted to a team using setTeamColor, this function doesnt work?
-
I have to guis, one for team A and another for team B, but could make with two different labels.. hm right, need to change it. Thanks.
-
Bahh stil not working, tonumber fives me bad argument, changed to tostring, no error, but no color changed I keep talking on char and my name didnt change color What the hell..? offtopic- ROFL! Aahah I am sorry bro my mistake quisBJ, was late
-
thanks both. I already tryed that quaispj , didnt work too Well I have using the function setTeamColor, it sets for all the team members, but I am using setNametagcolor before the setTeamColor, so no problem I guess.. Thanks guys! Tryed your solution now again, and now I have bad argument on fuction setPlayerNametagColor. Bahh, thePlayer is fine I guess.. Thanks guys.
-
hm okay thanks bro
-
Thanks for ur reply, no errors now, but I dont get any color modified on my name.. tryed /nametagcolor 100, 100, 100 and /nametagcolor 100 100 100 nothing.. thanks in advance
-
Okay this is a function to put a color on a name of a player right? I added this to my script just for test: function nametagColorChange ( thePlayer, commandName, r, g, b ) -- Apply the new color mix of RGB to the command handler activator setPlayerNametagColor ( thePlayer, r, g, 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 ) and then I get error on server console saying that its a bad argument, and I dont see my color get changed.. keeps white. thanks guys
