Anubhav
Members-
Posts
2,277 -
Joined
-
Last visited
Everything posted by Anubhav
-
Guyz, its my first HUD which I've tried. Don't worry I will update it. Just the thing is my school started today.
-
Don't use elementData for such a thing. -- SERVER myData = {} -- creating a table function setMyData(player, value) myData[player] = value -- setting the player value in table return true -- returning that it was sucessfully done end function getMyData(player) return myData[player] or false -- returning the data player has end function sendMyDataToClient() for k,v in ipairs(getElementsByType("player")) do -- looping through all players triggerClientEvent(v, "sendMyData", v, getMyData(v)) -- triggering a event to client "sendMyData", with the arguments of getMyData(v) which means which data player has! end end -- CLIENT addEvent("sendMyData", true) addEventHandler("sendMyData", root, function(data) outputChatBox(data) -- output the player its data end )
-
I will upload it after school. I din't add any screens for v 0.5.0 because I WENT to sleep, its morning ( school time ) Done.
-
local marker = createMarker (255.5, 77.4, 1002.9, "cylinder", 2, 0, 0, 255, 255) setElementInterior(marker, 6) local Skins={ {"Female Uniform", 246}, {"Street Cop1 Uniform", 265}, {"Street Cop2 Uniform", 266}, {"Street Cop3 Uniform", 267}, {"LS Uniform", 280}, {"SF Uniform", 281}, {"LV Uniform", 282}, {"RCSD Uniform", 283}, {"Bike Uniform", 284}, {"SWAT Uniform", 285}, {"BCSD Uniform", 288}, {"Own Skin", localPlayer}, } function Job() local data = getElementData("Faction") if (data == "SAPD") then Jobwindow = guiCreateWindow(0.40, 0.50, 0.80, 1, "Select Uniform", false) playerSkin = guiCreateGridList(0.20, 0.30, 0.15, 0.60, false) column = guiGridListAddColumn(playerSkin, "Uniform", 0.60) accept = guiCreateButton(0.4, 0.5, 0.4, 1, "OK", Jobwindow, false) refuse = guiCreateButton(0.4, 0.5, 0.8, 1, "Go off duty", Jobwindow, false) cancel = guiCreateButton(0.4, 0.5, 0.4, 1, "Cancel", Jobwindow, false) memo = guiCreateMemo(17, 79, 414, 246, "Select a uniform and click Accept to go on duty , or Go off duty to exit the job. ", Jobwindow, true) guiMemoSetReadOnly(memo, true) guiSetVisible(Jobwindow,true) showCursor(true) for _,v in ipairs(Skins) do local row = guiGridListAddRow(playerSkin) guiGridListSetItemText(playerSkin, row, 1, v[1], false, false) guiGridListSetItemData(playerSkin, row, 1, v[2]) if (guiGridListGetSelectedItem(source) ~= -1) then local Select = tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source), 1) ) if (Select and Select ~= ' ')then triggerServerEvent("SetPlayerSkin", localPlayer, tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source),1))) end end end end end addEventHandler("onClientMarkerHit", marker, Job) function Buttons() local data = getElementData("Rank") local Select = tonumber(guiGridListGetItemData(source, guiGridListGetSelectedItem(source), 1) ) if source == accept then guiSetVisible(Jobwindow, false) showCursor(false) if (data == ("Cadet" or "Chief") ) and Select == 1 then setElementModel(localPlayer, 246) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job" , "Police Officer") elseif (data == ("Cadet" or "Chief") ) and Select == 2 then setElementModel(localPlayer, 265) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job" , "Police Officer") elseif (data == ("Cadet" or "Chief") ) and Select == 3 then setElementModel(localPlayer, 266) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == ("Cadet" or "Chief") ) and Select == 4 then setElementModel(localPlayer, 267) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == ("Cadet" or "Chief") ) and Select == 5 then setElementModel(localPlayer, 280) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == ("Cadet" or "Chief") ) and Select == 6 then setElementModel(localPlayer, 281) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == (" Cadet" or "Chief") ) and Select == 7 then setElementModel(localPlayer, 282) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == ("Cadet" or "Chief") ) and Select == 8 then setElementModel(localPlayer, 283) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == (" Cadet" or "Chief") ) and Select == 9 then setElementModel(localPlayer, 284) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == "SWAT Officer" or ( "Captain" and "Chief" ) ) and Select == 10 then setElementModel(localPlayer, 285) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == (" Cadet" or "Chief") and Select == 11 then setElementModel(localPlayer, 288) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif (data == ( "Lieutenant" or "Chief") ) and Select == 12 then setElementModel(localPlayer, localPlayer) triggerServerEvent("PDteam", localPlayer) setElementData(localPlayer, "Job", "Police Officer") elseif source == refuse then setElementModel(localPlayer, localPlayer) triggerServerEvent("Citizenteam", localPlayer) setElementData(localPlayer, "Job" "Unemployed") guiSetVisible(Jobwindow, false) showCursor(false) elseif source == cancel then guiSetVisible(Jobwindow, false) showCursor(false) else outputChatBox("You have no access!", localPlayer, 255, 0, 0, true) end end end addEvent("SetPlayerSkin", true) addEventHandler("SetPlayerSkin", root, Buttons) addEventHandler("onClientGUIClick", root, Buttons)
-
and use a getResourceFromName on it.
-
Oh wait that? Are you sure the meta.xml somehow looks like this: <meta> <script src="yourscriptname.lua" type="client" /> </meta>
-
Sure. Do it without guiGetScreenSize only 1 minute work right?
-
Ohai! One more upload from A-TEAM! ( Anubhav Scripters Team ). DEVELOPERS: Sidhkeer as designer. ( bit only ) Anubhav as the coder. INFORMATION: A small HUD made by me. This contains time, health, armor and money. The money is converted by the usefull function on wiki. CREDITS: ---- Converting: Wiki ---- Wiki: For helping me in making it ---- Remp: GUIEditor ( Helped me for calculating from guiGetScreenSize ) ---- Anubhav: For making this resource ---- Sidhkeer: Helping a bit in design ---- xPhanTom: For images ( weapon images ). ( https://community.multitheftauto.com/in ... ls&id=7502 ) https://community.multitheftauto.com/in ... s&id=10176 You can get versions information there! Please rate 4-5! I will decompile this if I get +1000 downloads!
-
Ya compiled it? Din't you ask me the same-one to do it? P.S: You told me that its not your resource, and you are telling you compiled it? There were the scripts.
-
Why would he add it in ACL? Did I understand that wrong? He added it in Admin still it din't work .. See my post above its blocked so its blocked.
-
Why would he add it in ACL? ------ You can't use the resource mp because the file mp_server.luac is blocked by MTA:TEAM.
-
https://community.multitheftauto.com/ind ... s&id=10174 Spider roam hud DONE
-
Now its not needed I solved the problem without using this SQL.
-
local pBlips = { } function blipsRestart() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end setTimer(blipsRestart,10000,0) addEventHandler("onResourceStart", resourceRoot, blipsRestart) function blipJoin() addTeamBlip(source) end addEventHandler("onPlayerLogin",getRootElement(),blipJoin) function addTeamBlip(player) if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips local theGang = getElementData ( player, "gang" ) if ( theGang and theGang ~= "None" ) then local r, g, b = getPlayerNametagColor( player ) local theBlip = createBlipAttachedTo( player, 0, 2, 0, 255, 0 ) -- Change visibility to only the team members setElementVisibleTo( theBlip, root, false ) for index, value in ipairs ( getPlayersByGang ( theGang ) ) do -- THIS setElementVisibleTo( theBlip, value, true ) end pBlips[player] = theBlip end end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) addEventHandler ( "onPlayerQuit", root, destroyBlip ) function getPlayersByGang ( gang ) local players = { } for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "gang" ) == gang ) then table.insert ( players, player ) end end return players end
-
addCommandHandler("turflist", function(p) local turfs = {} for k,v in pairs(turfPos) do local turfGang = executeSQLQuery("SELECT GangOwner FROM BoDTurfSystem WHERE Turfs=?", "Turf["..tostring(k).."]" ) if k ~= 0 then for l, i in pairs(turfs) do if turfs[k][1] == turfs[i][1] then turfs[k] = {turfGang[1].GangOwner, turfs[k][2]+1} else turfs[k] = {turfGang[1].GangOwner,1} end end else turfs[k] = {turfGang[1].GangOwner,1} end end for i, v in pairs(turfs) do outputChatBox("Group:"..tostring(turfs[i][1]).." Value:"..tostring(turfs[i][2])) end triggerClientEvent(p, "openList", p, turfs) end ) EDIT: Why don't it output something? Because table is empty?
-
I did that to no nothing!
-
I'm just using another method tables for this thing. Its realy hard with SQL...
-
Hmm, I am not using that method, now one more doubt. addCommandHandler("turflist", function(p) local turfs = {} for k,v in pairs(turfPos) do local turfGang = executeSQLQuery("SELECT GangOwner FROM BoDTurfSystem WHERE Turfs=?", "Turf["..tostring(k).."]" ) if k ~= 0 then for l, i in pairs(turfs) do if turfs[k][1] == turfs[i][1] then turfs[k] = {turfGang[1].GangOwner, turfs[k][2]+1} else turfs[k] = {turfGang[1].GangOwner,1} end end else turfs[k] = {turfGang[1].GangOwner,1} end end for i, v in pairs(turfs) do outputChatBox("Group:"..tostring(turfs[i][1]).." Value:"..tostring(turfs[i][2])) end triggerClientEvent(p, "openList", p, turfs) end ) no outputs no errors
-
Hello guyz: I did something like this: addCommandHandler("turflist", function(p) local turfs = {} for k,v in ipairs(turfPos) do local turfGang = executeSQLQuery("SELECT GangOwner FROM BoDTurfSystem WHERE Turfs=?", "Turf["..tostring(k).."]" ) if turfs[turfGang[1].GangOwner] then turfs[turfGang[1].GangOwner] = turfs[turfGang[1].GangOwner]+1 else turfs[turfGang[1].GangOwner] = 1 end end for i, v in ipairs(turfs) do outputChatBox("Group:"..tostring(i).." Value:"..tostring(k)) end triggerClientEvent(p, "openList", p, turfs) end ) No outputs, why?