-
Posts
527 -
Joined
-
Last visited
-
Days Won
3
Everything posted by justn
-
I know . . but .. can you help or not ?
-
So I have this problem with a clothes shop, and the only problem is, i need to click the buy button alot of times, then it will add clothes Client: addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), colID ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), colname ) local Selected3 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), clomod ) if getPedClothes ( localPlayer, tonumber(Selected3)) then removePedClothes ( localPlayer, tonumber(Selected3)) triggerServerEvent("addClothes",localPlayer,Selected2,Selected3) exports["TopBarChat"]:sendClientMessage("#00ff00* #FFFFFFYou bought a "..Selected2.." for $25",255,255,255,true) else triggerServerEvent("addClothes",localPlayer,Selected2,Selected3) end end end end) Server: function clothes ( Selected2, Selected3) local stuff = math.random(0,17) addPedClothes (source,tostring(Selected2),tostring(Selected3),tonumber(stuff)) end addEvent("addClothes",true) addEventHandler("addClothes",getRootElement(),clothes)
-
Nice Job Man ! Very useful to some players.
-
getClothesByTypeIndex This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type).
-
Those links are very old.
-
My code works, for only some of the clothes like 'vest' etc..Maybe the local variable 'selected' isn't the type of clothes
-
Try this ( I dont know if works ) (NOTE: Client Side Only) addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == BuyClothes then guiSetVisible(Clothes_Window,false) local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes (localPlayer,tostring(Selected2),tostring(Selected2), tonumber(Selected)) outputChatBox("You selected a "..Selected2.." for $25") guiSetVisible(Clothes_Window,false) showCursor(false) end end end)
-
Can you explain, what exactly are you trying to do ? You just made a post and ask someone to combine it when we don't know what you want ?!
-
-- Part where i binded it function onPlayerTargetA ( player ) if ( isPlayerInTeam ( source, "Police" ) ) then if ( isElement ( player ) and getElementType ( player ) == "player" ) then if ( not isPlayerInTeam ( player, "Police" ) ) then bindKey ( source, "N", "down", function() exports [ "TopBarChat" ] : sendClientMessage ( "You have given " .. getPlayerName ( player ) .. " a ticket , Wait for him to pay it", source, 255, 0, 0, true ) exports [ "TopBarChat" ] : sendClientMessage ( "You have gotten a ticket ! Press 'H' to pay it!", player, 255, 0, 0, true ) bindKey ( player, "H", "down", payTheTicket, source, player ) end ) end end end end addEventHandler ( "onPlayerTarget", root, onPlayerTargetA ) function payTheTicket ( _, _, _, theCop, thePlayer ) givePlayerMoney ( theCop, 200 ) takePlayerMoney ( thePlayer, 200 ) setPlayerWantedLevel( thePlayer, 0 ) exports [ "TopBarChat" ] : sendClientMessage ( "The ticket has been paid by " .. getPlayerName ( thePlayer ), theCop, 255, 0, 0, true ) exports [ "TopBarChat" ] : sendClientMessage ( "You have paid the ticket to " .. getPlayerName ( theCop ), thePlayer, 255, 0, 0, true ) unbindKey ( thePlayer, "H", "down", payTheTicket ) end
-
Removed 'end' on line 24, should work now. addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) if ( tostring(Selected) ) then for i=1, 67 do clothe = getClothesByTypeIndex ( 0, i ) crow = guiGridListAddRow ( NameClothes_Grid ) guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) end end end) addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == CloseClothesWindow then guiSetVisible(Clothes_Window,false) showCursor(false) elseif source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes ( source, tostring(Selected2), "vest", Selected ) guiSetVisible(Clothes_Window,false) showCursor(false) end end)
-
This is for a police script I have, when the player gets ticketed, and he presses ''H'', when the player presses H again, his money goes down still, i think the problem is in the unbindKey function payTheTicket ( _, _, _, theCop, thePlayer ) givePlayerMoney ( theCop, 200 ) takePlayerMoney ( thePlayer, 200 ) setPlayerWantedLevel( thePlayer, 0 ) exports [ "TopBarChat" ] : sendClientMessage ( "The ticket has been paid by " .. getPlayerName ( thePlayer ), theCop, 255, 0, 0, true ) exports [ "TopBarChat" ] : sendClientMessage ( "You have paid the ticket to " .. getPlayerName ( theCop ), thePlayer, 255, 0, 0, true ) unbindKey ( thePlayer, "H", "down", payTheTicket ) end
-
Thx, can you guys help with 2 more things ? When i press l and talk, it only says [ Language ] #Twerky : and how do i determine, if a player has selected a certain language, and he talks in chat, then the message will only show for players who have selected that same language?
-
So hi, i have this small problem with a language chat im making ( in progress ) and the problem is, it doesnt output in chat or anytihng ERRORS: attempt to cancatenate local 'language' ( a boolean value) local language_handler = function(player,_,language,...) local text = table.concat({...}," ") local language = guiComboBoxGetItemText(guiComboBoxGetSelected(LanguageWindow)) outputChatBox("["..language.."] "..getPlayerName(localPlayer)..": "..text,root,255,255,255,true) end addCommandHandler("language",language_handler) bindKey("l","down","chatbox","language")
-
@Cheez3D Thanks man ! @Anubhav I used root, didn't work.
-
Ah, so hi, i have made a script for police, but within this script, i would like to ask, how do i get all online players > i just used localPlayer for test local x, y, z = getElementPosition ( localPlayer ) local PCriminalName = getPlayerName ( localPlayer ) local PCriminalWanted = getPlayerWantedLevel(localPlayer)
-
For the onPlayerWasted function, you must use spawnPlayer like this spawnPlayer(x,y,z,rotation,playerskin) -- leave playerskin as it is
-
Can you help me make so if player is in criminal team and hits marker then the dxdrawtext will be "Gangster: 1" and if another join then it will be "Gangster:2"
-
So, what i need help is setting the DxText visible to only the player who hits the marker.. and how do I make ( for example ) if the player is in criminal team then when he hits the marker it will show " Gangster: 1 " and if another Criminal joins it will be " Gangster: 2 " function onGangster (hitPlayer,interior,matchingDimension) if ( hitPlayer == localPlayer ) then if getTeamName(getPlayerTeam(localPlayer)) ~= "Police" or getTeamName(getPlayerTeam(localPlayer)) ~= "Medic" then setElementInterior ( localPlayer, 5, 1300.1059570313, -792.5771484375, 1085.00778125 ) setElementDimension ( localPlayer, 5 ) dxDrawText("Police: ", 11, 738, 207, 763, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, true, false) dxDrawText("Police: ", 11, 736, 207, 761, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, true, false) dxDrawText("Police: ", 9, 738, 205, 763, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, true, false) dxDrawText("Police: ", 9, 736, 205, 761, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, true, false) dxDrawText("Police: ", 10, 737, 206, 762, tocolor(66, 0, 254, 255), 1.00, "bankgothic", "left", "top", false, false, true, true, false) dxDrawText("Gangster: ", 217, 739, 477, 763, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, false) dxDrawText("Gangster: ", 217, 737, 477, 761, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, false) dxDrawText("Gangster: ", 215, 739, 475, 763, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, false) dxDrawText("Gangster: ", 215, 737, 475, 761, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, false) dxDrawText("Gangster: ", 216, 738, 476, 762, tocolor(253, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, false) dxDrawText("Medic:", 495, 738, 686, 759, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, false, true, true, false) dxDrawText("Medic:", 495, 736, 686, 757, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, false, true, true, false) dxDrawText("Medic:", 493, 738, 684, 759, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, false, true, true, false) dxDrawText("Medic:", 493, 736, 684, 757, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, false, true, true, false) dxDrawText("Medic:", 494, 737, 685, 758, tocolor(20, 232, 225, 255), 1.00, "bankgothic", "left", "top", true, false, true, true, false) end end end addEventHandler("onClientMarkerHit", gangsterMarker, onGangster ) addEventHandler("onClientRender", root, onGangster )
-
The track is awesome ! cant wait to see more of your maps !
-
Love the track and the deco, looks enjoyable