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:

  Reveal hidden contents

Client:

  Reveal hidden contents
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:

  Reveal hidden contents
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...