Jump to content

SkinShop Gui and Cursor


Matevsz

Recommended Posts

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

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

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
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
function GUI(hitPlayer) 
       if hitPlayer == localPlayer then 
              showCursor(true) 
              guiSetVisible(yourGridList,true) 
       end 
end 
addEventHandler("onClientMarkerHit", yourMarker, GUI)  

Link to comment

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
  
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...