Matevsz Posted May 22, 2016 Share Posted May 22, 2016 Hi, I want to make the entry into the marker "markerKupnaSkina" appeared Gui and cursor, but do not see anything. Server: local markerKupnaSkina = createMarker(161.30000305176, -83.900001525879, 1000.799987793, "cylinder", 1, 0,0,255,255) function TeleportDoSkinShop(player) if getElementType(player)=="player" then if source == wejscie then setElementPosition(player, 161.60000610352, -95.699996948242, 1001.799987793) setElementInterior(player, 18) setElementInterior(wyjscie, 18) setElementInterior(sprzedawca, 18) setElementInterior(markerKupnaSkina, 18) setElementFrozen(player, true) setTimer(setElementFrozen,30000,1,player,false) end end end addEventHandler("onMarkerHit", wejscie, TeleportDoSkinShop) function WybierzSkina(player) if getElementType(player)=="player" then if source == markerKupnaSkina then triggerClientEvent(player, "onSkinMarkerHit", player) triggerClientEvent(player, "onClientResourceStart", player) end end end addEventHandler("onMarkerHit", markerKupnaSkina, WybierzSkina) Client: local ped = createPed(0, 180.10000610352, -88.199996948242, 1002, 87.9990844) addEvent("onClientResourceStart", true) addEventHandler("onClientResourceStart", resourceRoot, function() gridlist = guiCreateGridList(1350, 383, 236, 293, false) guiGridListAddColumn(gridlist, "Skiny", 0.5) guiGridListAddColumn(gridlist, "ID", 0.5) for i = 1, 20 do guiGridListAddRow(gridlist) end guiGridListSetItemText(gridlist, 0, 1, "Mężczyźni", false, false) guiGridListSetItemColor(gridlist, 0, 1, 206, 0, 0, 255) guiGridListSetItemText(gridlist, 0, 2, " ", false, false) guiGridListSetItemText(gridlist, 1, 1, "CJ", false, false) guiGridListSetItemText(gridlist, 1, 2, "0", false, false) guiGridListSetItemText(gridlist, 2, 1, "Maccer", false, false) guiGridListSetItemText(gridlist, 2, 2, "2", false, false) guiGridListSetItemText(gridlist, 3, 1, "Taxi Driver", false, false) guiGridListSetItemText(gridlist, 3, 2, "7", false, false) guiGridListSetItemText(gridlist, 4, 1, "Mr. Whittaker", false, false) guiGridListSetItemText(gridlist, 4, 2, "15", false, false) guiGridListSetItemText(gridlist, 5, 1, "DJ", false, false) guiGridListSetItemText(gridlist, 5, 2, "19", false, false) guiGridListSetItemText(gridlist, 6, 1, "Joe", false, false) guiGridListSetItemText(gridlist, 6, 2, "21", false, false) guiGridListSetItemText(gridlist, 7, 1, "Ped", false, false) guiGridListSetItemText(gridlist, 7, 2, "22", false, false) guiGridListSetItemText(gridlist, 8, 1, "Drug Dealer", false, false) guiGridListSetItemText(gridlist, 8, 2, "29", false, false) guiGridListSetItemText(gridlist, 9, 1, "Ryder", false, false) guiGridListSetItemText(gridlist, 9, 2, "86", false, false) guiGridListSetItemText(gridlist, 10, 1, " ", false, false) guiGridListSetItemText(gridlist, 10, 2, " ", false, false) guiGridListSetItemText(gridlist, 11, 1, "Kobiety", false, false) guiGridListSetItemColor(gridlist, 11, 1, 23, 114, 40, 255) guiGridListSetItemText(gridlist, 11, 2, " ", false, false) guiGridListSetItemText(gridlist, 12, 1, "Rich", false, false) guiGridListSetItemText(gridlist, 12, 2, "12", false, false) guiGridListSetItemText(gridlist, 13, 1, "Normal Girl", false, false) guiGridListSetItemText(gridlist, 13, 2, "40", false, false) guiGridListSetItemText(gridlist, 14, 1, "Grandmother", false, false) guiGridListSetItemText(gridlist, 14, 2, "54", false, false) guiGridListSetItemText(gridlist, 15, 1, "Businesswoman", false, false) guiGridListSetItemText(gridlist, 15, 2, "91", false, false) guiGridListSetItemText(gridlist, 16, 1, "Normal Girl 2", false, false) guiGridListSetItemText(gridlist, 16, 2, "93", false, false) guiGridListSetItemText(gridlist, 17, 1, "Farm Girl", false, false) guiGridListSetItemText(gridlist, 17, 2, "131", false, false) guiGridListSetItemText(gridlist, 18, 1, "Normal Girl 3", false, false) guiGridListSetItemText(gridlist, 18, 2, "169", false, false) guiGridListSetItemText(gridlist, 19, 1, "Barbara", false, false) guiGridListSetItemText(gridlist, 19, 2, "190", false, false) guiSetVisible(gridlist, false) end) addEvent("onSkinMarkerHit", true) addEventHandler("onSkinMarkerHit", getRootElement(), function() if not isPedInVehicle(getLocalPlayer()) then setCameraMatrix(ped, 174.46969604492, -88.212097167969, 1003.6256713867, 175.40690612793, -88.209663391113, 1003.2769165039) guiSetVisible(gridlist, true) showCursor(true) setElementInterior(ped, 18) setElementDimension(ped, 1) end end) Link to comment
Dimos7 Posted May 22, 2016 Share Posted May 22, 2016 i think you need window for make a gridlist and put false and true the window guiCreateWindow Link to comment
Matevsz Posted May 22, 2016 Author Share Posted May 22, 2016 Needless to say the window before I saw Grid, I added to the client: if isElementWithinMarker(getLocalPlayer()) then addEvent("onSkinMarkerHit", true) addEventHandler("onSkinMarkerHit", getRootElement(), function() if not isPedInVehicle(getLocalPlayer()) then if isElementWithinMarker(getLocalPlayer()) then setCameraMatrix(ped, 174.46969604492, -88.212097167969, 1003.6256713867, 175.40690612793, -88.209663391113, 1003.2769165039) guiSetVisible(gridlist, true) showCursor(true) setElementInterior(ped, 18) setElementDimension(ped, 1) end end) and DebugScript shows error: ERROR: Bad argument @ "isElementWithinMarker" [expected marker at argument 2, not none] Server triggered clientside event onClientResourceStart, but event is not marked as remotly triggerable Link to comment
Dimos7 Posted May 22, 2016 Share Posted May 22, 2016 yes because in 2 argument need the marker Link to comment
Matevsz Posted May 22, 2016 Author Share Posted May 22, 2016 But, if I add: triggerClientEvent(player, "onSkinMarkerHit", player) triggerClientEvent(player, "onClientResourceStart", player) function TeleportDoSkinShop(player) if getElementType(player)=="player" then if source == wejscie then setElementPosition(player, 161.60000610352, -95.699996948242, 1001.799987793) setElementInterior(player, 18) setElementInterior(wyjscie, 18) setElementInterior(sprzedawca, 18) setElementInterior(markerKupnaSkina, 18) setElementFrozen(player, true) setTimer(setElementFrozen,30000,1,player,false) triggerClientEvent(player, "onSkinMarkerHit", player) triggerClientEvent(player, "onClientResourceStart", player) end end end addEventHandler("onMarkerHit", wejscie, TeleportDoSkinShop) This gui and the cursor show up immediately after entry... SS: http://imgur.com/FRxSgsn Link to comment
Dimos7 Posted May 22, 2016 Share Posted May 22, 2016 local markerKupnaSkina = createMarker(161.30000305176, -83.900001525879, 1000.799987793, "cylinder", 1, 0,0,255,255) setElementInterior(markerKupnaSkina, 18) function TeleportDoSkinShop(player) if getElementType(player)=="player" then if source == wejscie then setElementPosition(player, 161.60000610352, -95.699996948242, 1001.799987793) setElementInterior(player, 18) setElementInterior(wyjscie, 18) setElementInterior(sprzedawca, 18) setElementFrozen(player, true) setTimer(setElementFrozen,30000,1,player,false) end end end addEventHandler("onMarkerHit", wejscie, TeleportDoSkinShop) function WybierzSkina(player) if getElementType(player)=="player" then if source == markerKupnaSkina then triggerClientEvent(player, "onSkinMarkerHit", player) triggerClientEvent(player, "onClientResourceStart", player) end end end addEventHandler("onMarkerHit", markerKupnaSkina, WybierzSkina) Link to comment
Matevsz Posted May 22, 2016 Author Share Posted May 22, 2016 I had so after the entry did not see the marker also Help Link to comment
Matevsz Posted May 23, 2016 Author Share Posted May 23, 2016 I can't see gui and cursor in marker Screen: http://imgur.com/ITldW35 Link to comment
BEN. Posted May 23, 2016 Share Posted May 23, 2016 function GUI(hitPlayer) if hitPlayer == localPlayer then showCursor(true) guiSetVisible(yourGridList,true) end end addEventHandler("onClientMarkerHit", yourMarker, GUI) Link to comment
Matevsz Posted May 23, 2016 Author Share Posted May 23, 2016 I have a marker on the server side and client-side GUI, this code give side?? Link to comment
BEN. Posted May 23, 2016 Share Posted May 23, 2016 you can make marker on client side too because it shared function Link to comment
Matevsz Posted May 23, 2016 Author Share Posted May 23, 2016 thanks !!! Now, why does not work SetCameraMatrix? ClientSide: local ped = createPed(0, 180.10000610352, -88.199996948242, 1002, 87.9990844) local markerKupnaSkina2 = createMarker(161.30000305176, -83.900001525879, 1000.799987793, "cylinder", 1, 0,0,255,255) setElementInterior(markerKupnaSkina2, 18) addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("onMarkerHit", getLocalPlayer(), ped) gridlist = guiCreateGridList(1350, 383, 236, 293, false) guiGridListAddColumn(gridlist, "Skiny", 0.5) guiGridListAddColumn(gridlist, "ID", 0.5) for i = 1, 20 do guiGridListAddRow(gridlist) end guiGridListSetItemText(gridlist, 0, 1, "Mężczyźni", false, false) guiGridListSetItemColor(gridlist, 0, 1, 206, 0, 0, 255) guiGridListSetItemText(gridlist, 0, 2, " ", false, false) guiGridListSetItemText(gridlist, 1, 1, "CJ", false, false) guiGridListSetItemText(gridlist, 1, 2, "0", false, false) guiGridListSetItemText(gridlist, 2, 1, "Maccer", false, false) guiGridListSetItemText(gridlist, 2, 2, "2", false, false) guiGridListSetItemText(gridlist, 3, 1, "Taxi Driver", false, false) guiGridListSetItemText(gridlist, 3, 2, "7", false, false) guiGridListSetItemText(gridlist, 4, 1, "Mr. Whittaker", false, false) guiGridListSetItemText(gridlist, 4, 2, "15", false, false) guiGridListSetItemText(gridlist, 5, 1, "DJ", false, false) guiGridListSetItemText(gridlist, 5, 2, "19", false, false) guiGridListSetItemText(gridlist, 6, 1, "Joe", false, false) guiGridListSetItemText(gridlist, 6, 2, "21", false, false) guiGridListSetItemText(gridlist, 7, 1, "Ped", false, false) guiGridListSetItemText(gridlist, 7, 2, "22", false, false) guiGridListSetItemText(gridlist, 8, 1, "Drug Dealer", false, false) guiGridListSetItemText(gridlist, 8, 2, "29", false, false) guiGridListSetItemText(gridlist, 9, 1, "Ryder", false, false) guiGridListSetItemText(gridlist, 9, 2, "86", false, false) guiGridListSetItemText(gridlist, 10, 1, " ", false, false) guiGridListSetItemText(gridlist, 10, 2, " ", false, false) guiGridListSetItemText(gridlist, 11, 1, "Kobiety", false, false) guiGridListSetItemColor(gridlist, 11, 1, 23, 114, 40, 255) guiGridListSetItemText(gridlist, 11, 2, " ", false, false) guiGridListSetItemText(gridlist, 12, 1, "Rich", false, false) guiGridListSetItemText(gridlist, 12, 2, "12", false, false) guiGridListSetItemText(gridlist, 13, 1, "Normal Girl", false, false) guiGridListSetItemText(gridlist, 13, 2, "40", false, false) guiGridListSetItemText(gridlist, 14, 1, "Grandmother", false, false) guiGridListSetItemText(gridlist, 14, 2, "54", false, false) guiGridListSetItemText(gridlist, 15, 1, "Businesswoman", false, false) guiGridListSetItemText(gridlist, 15, 2, "91", false, false) guiGridListSetItemText(gridlist, 16, 1, "Normal Girl 2", false, false) guiGridListSetItemText(gridlist, 16, 2, "93", false, false) guiGridListSetItemText(gridlist, 17, 1, "Farm Girl", false, false) guiGridListSetItemText(gridlist, 17, 2, "131", false, false) guiGridListSetItemText(gridlist, 18, 1, "Normal Girl 3", false, false) guiGridListSetItemText(gridlist, 18, 2, "169", false, false) guiGridListSetItemText(gridlist, 19, 1, "Barbara", false, false) guiGridListSetItemText(gridlist, 19, 2, "190", false, false) guiSetVisible(gridlist, false) end) addEvent("onSkinMarkerHit", true) addEventHandler("onSkinMarkerHit", getRootElement(), function() if not isPedInVehicle(getLocalPlayer()) then triggerServerEvent("onMarkerHit", getLocalPlayer(), ped) end end) function PokazGUI(hitPlayer) if hitPlayer == localPlayer then showCursor(true) guiSetVisible(gridlist, true) setCameraMatrix(ped, 174.46969604492, -88.212097167969, 1003.6256713867, 175.40690612793, -88.209663391113, 1003.2769165039) setElementInterior(ped, 18) setElementDimension(ped, 1) end end addEventHandler("onClientMarkerHit", markerKupnaSkina2, PokazGUI) Link to comment
Dimos7 Posted May 23, 2016 Share Posted May 23, 2016 (edited) ops sorry wrong Edited May 23, 2016 by Guest Link to comment
Matevsz Posted May 23, 2016 Author Share Posted May 23, 2016 (edited) @Edit SetCameraMatrix already running, but as we enter the interior is "ped" already is and how I come to this marker shows setCameraMatrix but without the "ped" Edited May 23, 2016 by Guest Link to comment
Dimos7 Posted May 23, 2016 Share Posted May 23, 2016 why you put ped in dimession 1 also what /debugscript 3 say? Link to comment
Bean666 Posted May 23, 2016 Share Posted May 23, 2016 don't use setCameraMatrix use setElementPosition setElementRotation and dont put the setElementInterior(ped, 18) on the markerhit , put it on the top with your createPed. wd be way easier. Link to comment
Matevsz Posted May 23, 2016 Author Share Posted May 23, 2016 Good already repaired with SetCameraMatrix, but thanks for your help, now the last thing how to do that when you select a skin from Gridlist, ped was wearing it? Link to comment
Bean666 Posted May 23, 2016 Share Posted May 23, 2016 can you show us the part of? guiGridListGetSelectedItem Link to comment
Matevsz Posted May 24, 2016 Author Share Posted May 24, 2016 Just that I have not yet, I know that you have to use: guiGridListGetSelectedItem and guiGridListSetItemText Could you give an example? Link to comment
BEN. Posted May 24, 2016 Share Posted May 24, 2016 https://wiki.multitheftauto.com/wiki/Sc ... Tutorial_1 Link to comment
Matevsz Posted May 25, 2016 Author Share Posted May 25, 2016 function ChangeSkin(state) if state == "left" then local skin = guiGridListGetItemText(gridlist, guiGridListGetSelectedItem(gridlist), 2) setElementModel(ped, skin) end end addEventHandler("onClientGUIClick", gridlist, ChangeSkin) Error: DB3: bad argument @ 'addEventHandler' [Expected element at argument 2, got nil] Link to comment
ViRuZGamiing Posted May 25, 2016 Share Posted May 25, 2016 where's gridlist declared? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now