Jump to content

some problems


Wisin

Recommended Posts

Hi, im having some problems creating a skin shop, first problem is when a player hits the marker all see the selector, and second its i dont understand how to insert the take player money, if someone can help me here its client-side script.

marker = createMarker ( 1936.3120117188, 2301.4567871094, 10.8203125, "cylinder", 3, 254, 1, 2, 99 )
createBlipAttachedTo ( marker, 12 )
function CreateSelectorWindow( hitPlayer, matchingDimension )
if ( isElementWithinMarker(getLocalPlayer(), marker) ) then
wdwselector = guiCreateWindow(0.438,0.880,0.15,0.10,"Skin Shop",true)
guiWindowSetMovable(wdwselector,false)
btnLeft = guiCreateButton(0.0,0.4,0.200,0.350,"<-",true,wdwselector)
btnRight = guiCreateButton(0.76,0.4,0.200,0.350,"->",true,wdwselector)
btnSelect = guiCreateButton(0.30,0.4,0.400,0.350,"Select",true,wdwselector)
guiSetVisible(wdwselector, true)
end
end
function selectorenable ()
CreateSelectorWindow()
addEventHandler("onClientGUIClick", btnLeft, clientSkinLeft, false)
addEventHandler("onClientGUIClick", btnSelect, clientSkinSelect, false)
addEventHandler("onClientGUIClick", btnRight, clientSkinRight, false)
if (wdwselector ~= nil) then
guiSetVisible(wdwselector, true)
triggerServerEvent("FrontCamera", getLocalPlayer(),getLocalPlayer())
end 
showCursor(true)
end
addEventHandler ( "onClientMarkerHit", getRootElement(), selectorenable )
function clientSkinSelect(button)
if button == "left" then
guiSetVisible(wdwselector, false)
showCursor(false)
triggerServerEvent("SkinSelected", getLocalPlayer(),getLocalPlayer())
end
end
 
function clientSkinRight(button)
if button == "left" then
triggerServerEvent("SkinRight", getLocalPlayer(),getLocalPlayer())
end
end
 
function clientSkinLeft(button)
if button == "left" then
triggerServerEvent("SkinLeft", getLocalPlayer(),getLocalPlayer())
end
end

Edited by Guest
Link to comment

- onClientMarkerHit is triggered whenever player enters a marker (you or anyone else). You create window when you or someone else enters your marker. Make sure the player who entered the marker is "you" (getLocalPlayer)

- You seem to create 2 windows. 1 in CreateSelectorWindow and 1 in selectorenable which calls CreateSelectorWindow.

- takePlayerMoney whenever they select a skin (clientSkinSelect seems to be function called when player selects skin, that's where you take money away)

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