
Hero192
Members-
Posts
512 -
Joined
-
Last visited
Everything posted by Hero192
-
I mean always the lastest message be with 240 Alpha and others with 140. like if 3 Messages sents, the last message of these 3 lines be with 240 others with 140 and if it draw only one message then it show with 240 so last message shows with this alpha 240 I hope you understand abit more
-
Not that but thanks for your try, i want to change the ALPHA of Rectangle not texts, i need the Last Rectangle always be with 240 and others with 140 Aplha
-
It's not leaked script and im not from these people who steal scripts, the author released it and i have his permission. So can anyone give me a hand ?
-
To be more clear there's 5 max messages, i want the first message be always with (0,0,0,240) others with this color (0,0,0,140), anyone can help me?
-
it's topbarchat system, i want let the first rectangle shows with dark color and others shows with alpha 100 for example , local timer = nil local text = "" local text2 = "" local messages = { } local r,g,b = 255,255,255 local isColorCoded = false function sendMessage( message, red, green, blue, colorCoded ) if colorCoded == nil then colorCoded = false end text = message r = red g = green b = blue isColorCoded = colorCoded if isTimer( timer ) then killTimer( timer ) end timer = setTimer( function() text = "" end, 200, 1 ) end addEvent( "onTextAdd", true ) addEventHandler( "onTextAdd", getRootElement(), sendMessage ) addEventHandler ( "onClientRender", root, function ( ) local tick = getTickCount ( ) local sx,sy = guiGetScreenSize ( ) if ( text ~= text2 and text ~= "" ) then table.insert ( messages, { text, true, tick + 7100, 120, r, g, b, isColorCoded }) end text2 = text if ( #messages > 5 ) then table.remove ( messages, 1 ) end for index, data in ipairs ( messages ) do local v1 = data[1] local v2 = data[2] local v3 = data[3] local v4 = data[4] local v5 = data[5] local v6 = data[6] local v7 = data[7] local v8 = data[8] dxDrawRectangle ( 390, (-22)+(index*21), 593, 21, tocolor( 0, 0, 0, v4+90 ) ) dxDrawText ( v1, 700, (-21)+(index*42), sx/2, 0, tocolor( v5, v6, v7, v4+100 ), 0.85, "default-bold", "center", "center", false, true, false, v8 ) if ( tick >= v3 ) then messages[index][4] = v4-120 if ( v4 <= 1 ) then table.remove ( messages, index ) end end end end)
-
Hey,i want to get color from this table to outputChatBox i tried but failed here's the ERROR attempt to index global 'tonumber( (a function value) local messages = { {"TEXT1",255,0,0}, {"TEXT2",0,0,255}, {"TEXT3",0,255,0} } local i = 0 function sendNextAutomatedMessage ( ) i = i + 1 if ( i > #messages ) then i = 1 end outputChatBox( messages [i], root ,tonumber[2],tonumber[3],tonumber[4]) setTimer ( sendNextAutomatedMessage, 150000, 1 ) end setTimer ( sendNextAutomatedMessage, 200, 1 )
-
I think so but i have no idea about how to use it thats why im asking for help
-
If i selected Torso for example CJ can't use it as clothes, i mean i need to get list of torso..etc like in this screenshot http://imgur.com/uQQwaBJ thanks for your help @GTX
-
Yeah man you're right, but there's a problem when i selecte to buy the clothes plus it shows as numbers not names idk why i tried tostring but not working ERROR:60: attempt to get length of local 'tempTable' (a number value)
-
Now no errors about that but i still have the problem about rows, when i hit the marker i have no rows of clothes in gridlist
-
Anyone can give hand please?
-
Doesn't works it give warning bad argument line 18 --client side guiGridListSetItemText (cjGrid, row, 1, v[1], false, false)
-
When i hit the marker i get the gui visible but with out rows (cj clothes..) only colums here's the warning WARNING:client.lua:20: atempt to index global 'cat' (a nil value)
-
--server side; i just didn't copied the full code local cjclothesmarker = { [1]={x=1648.5601806641,y=1732.7150878906,z=10.671875,dim=0,int=0} } local cjTable = { ["Torso"] = 100, ["Hair"] = 130, ["Legs"] = 150, ["Shoes"] = 170, ["Left Upper Arm"] = 110, ["Left Lower Arm"] = 110, ["Right Upper Arm"] = 110, ["Right Lower Arm"] = 110, ["Black Top"] = 120, ["Left Chest"] = 120, ["Right Chest"] = 120, ["Stomach"] = 140, ["Lower Back"] = 140, ["Extra1"] = 200, ["Extra2"] = 230, ["Extra3"] = 260, ["Extra4"] = 250, ["Suit"] , } addEventHandler("onResourceStart",resourceRoot, function () for index, pos in pairs(cjclothesmarker) do local cjmarker = createMarker(pos.x, pos.y, pos.z-1, "cylinder", 1.6, 247,187, 7, 120) setElementInterior(cjmarker, pos.int) setElementDimension(cjmarker, pos.dim) addEventHandler("onMarkerHit",cjmarker,onCJMarkerHit) end end) function onCJMarkerHit(player, dim) if not dim then return end if getElementType(player) == "player" then if getElementModel(player) > 0 then outputChatBox("Clothing Shop: You need the CJ skin to be able to buy clothes.",player,255,0,0) return end local result = {} local texture, model -- get all clothes result.allClothes = {} result.playerClothes = {} for type=0,17 do table.insert(result.allClothes, {type = type, name = getClothesTypeName(type)}) texture, model = getPedClothes(player, type) if texture then result.playerClothes[type] = {texture = texture, model = model} end end triggerClientEvent(player,"cjshop:show",player,result) end end addEvent("cjshop:buy",true) addEventHandler("cjshop:buy",root, function (client, tempTable) local cashToPay = 0 if (#tempTable > 0) then for index, cloth in pairs(tempTable) do if clothingPrices[getClothesTypeName(getTypeIndexFromClothes(cloth[1], cloth[2]))] then cashToPay = cashToPay + tonumber(clothingPrices[getClothesTypeName(getTypeIndexFromClothes(cloth[1], cloth[2]))]) end end end if getPlayerMoney(client) >= cashToPay then outputChatBox(client,"CJ Shop: you don't have money to buy clothes.",255,0,0) for index, cloth in pairs(tempTable) do addPedClothes(client, cloth[1], cloth[2], getTypeIndexFromClothes(cloth[1], cloth[2])) end saveNewClothing(client) takePlayerMoney(client, tonumber(cashToPay)) outputChatBox(client, "Clothing shop: Come back soon!",0,255,0) else outputChatBox(client, "Clothing shop: You need "..tonumber(cashToPay) .." to buy this clothing.",255,0,0) end end) function saveNewClothing(player) for type=0,17 do local texture, model = getPedClothes(player, type) setAccountData(getPlayerAccount(player),"clothes_".. type,tostring(texture) ..",".. tostring(model)) end end
-
Hey guys, i want make CJ Clothes Shop and i stuck, i want these clothes on table shows in gridlist and i can buy them. Here's my code: --client side: cjwindow = guiCreateWindow(519,174,313,332,"CJ",false) guiSetVisible (cjwindow, false) buybtn = guiCreateButton(13,297,131,27,"Buy",false,cjwindow) rejectbtn = guiCreateButton(170,297,131,27,"Cancel",false,cjwindow) cjGrid = guiCreateGridList(9,20,295,274,false,cjwindow) guiGridListSetSelectionMode(cjGrid,0) guiGridListAddColumn(cjGrid,"CJ Clothes:",0.85) addEvent("cjshop:show",true) addEventHandler("cjshop:show",root, function (cjTable) guiSetVisible(cjwindow,true) showCursor(true) guiGridListClear(cjGrid) for i,v in ipairs (cjTable.allClothes) do local row = guiGridListAddRow (cjGrid) guiGridListSetItemText (cjGrid, row, 1, v[1], false, false) end end) addEventHandler ("onClientGUIClick", root, function () if (source == rejectbtn) then guiSetVisible(cjwindow,false) showCursor(false) elseif (source == buybtn) then local row,col = guiGridListGetSelectedItem(cjGrid) if row and col and row ~= -1 and col ~= -1 then guiSetVisible(cjwindow,false) showCursor(false) local clothes = guiGridListGetItemText (cjGrid, guiGridListGetSelectedItem (cjGrid), 1) triggerServerEvent("cjshop:buy",localPlayer, clothes,guiGridListGetSelectedItem(cjGrid)+1) else outputChatBox("CJ Clothes Shop: You didn't selecte your clothes.",121,180,23) end end end) --server side: local cjclothesmarker = { [1]={x=1648.5601806641,y=1732.7150878906,z=10.671875,dim=0,int=0} } local cjTable = { ["Torso"] = 100, ["Hair"] = 130, ["Legs"] = 150, ["Shoes"] = 170, ["Left Upper Arm"] = 110, ["Left Lower Arm"] = 110, ["Right Upper Arm"] = 110, ["Right Lower Arm"] = 110, ["Black Top"] = 120, ["Left Chest"] = 120, ["Right Chest"] = 120, ["Stomach"] = 140, ["Lower Back"] = 140, ["Extra1"] = 200, ["Extra2"] = 230, ["Extra3"] = 260, ["Extra4"] = 250, ["Suit"] , } addEventHandler("onResourceStart",resourceRoot, function () for index, pos in pairs(cjclothesmarker) do local cjmarker = createMarker(pos.x, pos.y, pos.z-1, "cylinder", 1.6, 247,187, 7, 120) setElementInterior(cjmarker, pos.int) setElementDimension(cjmarker, pos.dim) addEventHandler("onMarkerHit",cjmarker,onCJMarkerHit) end end) function onCJMarkerHit(player, dim) if not dim then return end if getElementType(player) == "player" then if getElementModel(player) > 0 then outputChatBox("Clothing Shop: You need the CJ skin to be able to buy clothes.",player,255,0,0) return end local result = {} local texture, model -- get all clothes result.allClothes = {} result.playerClothes = {} for type=0,17 do table.insert(result.allClothes, {type = type, name = getClothesTypeName(type)}) texture, model = getPedClothes(player, type) if texture then result.playerClothes[type] = {texture = texture, model = model} end end triggerClientEvent(player,"cjshop:show",player,result) end end
-
Please i want to know which one is good for saving stuffs in database , MySQL , SQL , Sqlite or db.internal, and how to create this database / file..etc please im new on that inform me with details, thanks
-
Doesn't works it keep doing the same
-
-Read what i just wrote Currently when you do /kill the pickup will be at your place even if you didn't hit the main pickup(job) i want check if the player toke the main pickup (deliveryBaseLV) then he can drop the pickup on his death if he's not then he can't drop anything even if he dead.. --It's the main pickup deliveryBaseLV = createPickup(x, y, z, 3, 1210, 222, 1)
-
Currently when you do /kill the pickup will be at your place even if you didn't hit the main pickup(job) i want check if the player toke the main pickup (deliveryBaseLV) then he can drop the pickup on his death if he's not then he can't drop anything even if he dead.. local locations = { { 1463.80, 2823.78, 10.82}, { -1975.6, 1227.14, 31.83 }, { -2285.64, -12.7, 35.53 }, { -2147.59, -139.86, 36.73 }, { -2035.11, -43.72, 35.65 }, { -2120.84, -4.27, 35.53 }, { -2053.64, 82.59, 28.6 }, { -1917.56, 82.59, 28.6 }, { -1481, 686.4, 1.32 } } local pos = locations[math.random(#locations)] local x,y,z = unpack ( pos ) deliveryBaseLV = createPickup(x, y, z, 3, 1210, 222, 1) blip = createBlip(x, y, z, 37, 2, 255, 255, 255, 255, 0, 400) function pickupMallete(player) setElementData(player, "havePickup", true) burger = createObject(1210,0,0,0) myBlip = createBlipAttachedTo ( burger, 37 ) exports.attacher:attachElementToBone(burger,player,12,0,0.1,0.3,0,180,0) if isElement(blip) then destroyElement(blip) end if isElement(deliveryBaseLV) then destroyElement(deliveryBaseLV) end triggerClientEvent(player, "delivery:gotJob",player,pickupMallete) end addEventHandler ( "onPickupHit", deliveryBaseLV , pickupMallete ) local reward = math.random (2999,5300) function deliveryDoneJob() if isElement(burger) then destroyElement(burger) end if isElement(myBlip) then destroyElement(myBlip) end setElementData(source, "reward", reward) givePlayerMoney(source,reward) outputChatBox("You deliveryed the briefcase succesfully,Here's your reward: " ..reward.."$ well done!",source,0,255,231) setElementData(source, "havePickup", false) end addEvent("delivery:doneJob", true) addEventHandler("delivery:doneJob", root, deliveryDoneJob) function pickupthit(player) if getElementData(source, "havePickup") ~= true then return end if isElement(myBlip) then destroyElement(myBlip) end if isElement(deliveryBaseLV) then destroyElement(deliveryBaseLV) end if isElement(blip) then destroyElement(blip) end if isElement(deliveryBase) then destroyElement(deliveryBase) end if isElement(burger) then destroyElement(burger) end local x, y, z = getElementPosition ( source ) deliveryBase = createPickup ( x, y, z, 3, 1210, 200, 1 ) blip = createBlip(x, y, z, 37, 2, 255, 255, 255, 255, 0, 400) addEventHandler("onPickupHit", deliveryBase , goTake) end addEventHandler( "onPlayerWasted", root,pickupthit) function goTake(player) burger = createObject(1210,0,0,0) myBlip = createBlipAttachedTo ( burger, 37 ) exports.attacher:attachElementToBone(burger,player,12,0,0.1,0.3,0,180,0) if isElement(blip) then destroyElement(blip) end destroyElement(source) triggerClientEvent(player, "delivery:gotJob",player,pickupMallete) end end
-
I already used that,I am doing a job when you hit the pickup you get an Element in your hand 2nd thing when you suicide the pickup be at your death position, all that is going fine.. What im trying to do, Only the guy who toke the pickup if he dead then the pickup will be at his position, if he didn't take the pickup then even if he dead the pickup won't be at his position.
-
This part working fine , but the cmd works even if i didn't pick up the Pickup,how to check that, only the guy who picked up the pickup he who can use this cmd addCommandHandler("drop", function (player) if isElement(myBlip) then destroyElement(myBlip) end if isElement(deliveryBaseLV) then destroyElement(deliveryBaseLV) end if isElement(blip) then destroyElement(blip) end if isElement(deliveryBase) then destroyElement(deliveryBase) end if isElement(burger) then destroyElement(burger) end local x, y, z = getElementPosition ( player ) deliveryBase = createPickup ( x, y+3, z, 3, 1210, 200, 1 ) blip = createBlip(x, y+3, z, 37, 2, 255, 255, 255, 255, 0, 400) addEventHandler("onPickupHit", deliveryBase , goTake) end) function goTake(player) burger = createObject(1210,0,0,0) myBlip = createBlipAttachedTo ( burger, 37 ) exports.attacher:attachElementToBone(burger,player,12,0,0.1,0.3,0,180,0) if isElement(blip) then destroyElement(blip) end destroyElement(source) triggerClientEvent(player, "delivery:gotJob",player,pickupMallete) end
-
when i die it keep showing in map i want to destroy it
-
You understood me by wrong i think, im using it in client side i just need to get the blip from client side to server to destroy it there --Client-side client = getLocalPlayer() function create () local mkr = createMarker(826.1767578125, 853.82403564453,10.948932647705, "cylinder", 2.0, 255,20, 23) blp = createBlip(826.1767578125, 853.82403564453,10.948932647705, 51) setElementData(localPlayer,"blp",blp) addEventHandler("onClientMarkerHit", mkr, Done) end addEvent("delivery" , true) addEventHandler("delivery ", client, create ) function Done(player, matching) if (player == localPlayer and matching) then triggerServerEvent(" doneJob", player ) addEventHandler("onClientRender",root,message) destroyElement(source) destroyElement(blp) end end