Jump to content

[Help] GUI (Done)


amm2100

Recommended Posts

function spawnSanchez() 
local spawnthecar = createVehicle ( 468, 1543.4465332031, -1724.4774169922, 12.546875 ) 
warpPedIntoVehicle(source, spawnthecar) 
end 
local myMarker = createMarker( 1543.4465332031, -1724.4774169922, 12.546875 , "cylinder", 2.0, 250, 250, 250, 200, getRootElement()  ) 
function MarkerHit ( hitPlayer, matchingDimension ) 
    outputChatBox ( getPlayerName(hitPlayer) .. " Entered a Died Marker" ) 
end 
function createSpawnWindow() 
        windowSpawncar = guiCreateWindow(0.36, 0.70, 0.26, 0.29, "", true) 
        guiWindowSetSizable(windowSpawncar, false) 
        btnSancheZ = guiCreateButton(0.05, 0.12, 0.87, 0.14, "1: Sanchez", true, windowSpawncar) 
        local font0_PetitFormalScript = guiCreateFont(":guieditor/fonts/PetitFormalScript.ttf", 10) 
        guiSetFont(btnSancheZ, font0_PetitFormalScript) 
        guiSetProperty(btnSancheZ, "NormalTextColour", "FFFFFFFF") 
        btnVoodoo = guiCreateButton(0.05, 0.39, 0.87, 0.14, "2: Voodoo", true, windowSpawncar) 
        guiSetFont(btnVoodoo, font0_PetitFormalScript) 
        guiSetProperty(btnVoodoo, "NormalTextColour", "FFFFFFFF") 
        btnCaddy = guiCreateButton(0.06, 0.67, 0.86, 0.14, "3: Caddy", true, windowSpawncar) 
        guiSetFont(btnCaddy, font0_PetitFormalScript) 
        guiSetProperty(btnCaddy, "NormalTextColour", "FFFFFFFF")     
        guiSetVisible( windowSpawncar, true ) 
  
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
addEventHandler( "onClientMarkerHit", getRootElement(), createSpawnWindow) 

I made code to show GUI window when player enter the Marker but I need it to show to the player only not all Player's can any one help me

Edited by Guest
Link to comment
function spawnSanchez() 
local spawnthecar = createVehicle ( 468, 1543.4465332031, -1724.4774169922, 12.546875 ) 
warpPedIntoVehicle(source, spawnthecar) 
end 
local myMarker = createMarker( 1543.4465332031, -1724.4774169922, 12.546875 , "cylinder", 2.0, 250, 250, 250, 200, getRootElement()  ) 
function MarkerHit ( hitPlayer, matchingDimension ) 
    outputChatBox ( getPlayerName(hitPlayer) .. " Entered a Died Marker" ) 
end 
function createSpawnWindow() 
        windowSpawncar = guiCreateWindow(0.36, 0.70, 0.26, 0.29, "", true) 
        guiWindowSetSizable(windowSpawncar, false) 
        btnSancheZ = guiCreateButton(0.05, 0.12, 0.87, 0.14, "1: Sanchez", true, windowSpawncar) 
        local font0_PetitFormalScript = guiCreateFont(":guieditor/fonts/PetitFormalScript.ttf", 10) 
        guiSetFont(btnSancheZ, font0_PetitFormalScript) 
        guiSetProperty(btnSancheZ, "NormalTextColour", "FFFFFFFF") 
        btnVoodoo = guiCreateButton(0.05, 0.39, 0.87, 0.14, "2: Voodoo", true, windowSpawncar) 
        guiSetFont(btnVoodoo, font0_PetitFormalScript) 
        guiSetProperty(btnVoodoo, "NormalTextColour", "FFFFFFFF") 
        btnCaddy = guiCreateButton(0.06, 0.67, 0.86, 0.14, "3: Caddy", true, windowSpawncar) 
        guiSetFont(btnCaddy, font0_PetitFormalScript) 
        guiSetProperty(btnCaddy, "NormalTextColour", "FFFFFFFF")     
        guiSetVisible( windowSpawncar, true ) 
  
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
addEventHandler( "onClientMarkerHit", getRootElement(), createSpawnWindow) 

I made code to show GUI window when player enter the Marker but I need it to show to the player only not all Player's can any one help me

specifies the marker you want, and also if the player entering in the marker

  
  
function spawnSanchez() 
local spawnthecar = createVehicle ( 468, 1543.4465332031, -1724.4774169922, 12.546875 ) 
warpPedIntoVehicle(source, spawnthecar) 
end 
  
local myMarker = createMarker( 1543.4465332031, -1724.4774169922, 12.546875 , "cylinder", 2.0, 250, 250, 250, 200, getRootElement()  ) 
  
function MarkerHit ( hitPlayer, matchingDimension ) 
if (hitPlayer == localPlayer) then 
    outputChatBox ( getPlayerName(hitPlayer) .. " Entered a Died Marker" ) 
end 
end 
  
function createSpawnWindow(hitPlayer) 
if (hitPlayer == localPlayer) then 
        windowSpawncar = guiCreateWindow(0.36, 0.70, 0.26, 0.29, "", true) 
        guiWindowSetSizable(windowSpawncar, false) 
        btnSancheZ = guiCreateButton(0.05, 0.12, 0.87, 0.14, "1: Sanchez", true, windowSpawncar) 
        local font0_PetitFormalScript = guiCreateFont(":guieditor/fonts/PetitFormalScript.ttf", 10) 
        guiSetFont(btnSancheZ, font0_PetitFormalScript) 
        guiSetProperty(btnSancheZ, "NormalTextColour", "FFFFFFFF") 
        btnVoodoo = guiCreateButton(0.05, 0.39, 0.87, 0.14, "2: Voodoo", true, windowSpawncar) 
        guiSetFont(btnVoodoo, font0_PetitFormalScript) 
        guiSetProperty(btnVoodoo, "NormalTextColour", "FFFFFFFF") 
        btnCaddy = guiCreateButton(0.06, 0.67, 0.86, 0.14, "3: Caddy", true, windowSpawncar) 
        guiSetFont(btnCaddy, font0_PetitFormalScript) 
        guiSetProperty(btnCaddy, "NormalTextColour", "FFFFFFFF")     
        guiSetVisible( windowSpawncar, true ) 
  
end 
end 
addEventHandler ( "onClientMarkerHit", myMarker, MarkerHit ) 
addEventHandler( "onClientMarkerHit", myMarker, createSpawnWindow) 
  
  

test it.

Edited by Guest
Link to comment
function spawnSanchez() 
local spawnthecar = createVehicle ( 468, 1543.4465332031, -1724.4774169922, 12.546875 ) 
warpPedIntoVehicle(source, spawnthecar) 
end 
local myMarker = createMarker( 1543.4465332031, -1724.4774169922, 12.546875 , "cylinder", 2.0, 250, 250, 250, 200, getRootElement()  ) 
function MarkerHit ( hitPlayer, matchingDimension ) 
    if hitPlayer == localPlayer then 
       outputChatBox ( getPlayerName(hitPlayer) .. " Entered a Died Marker" ) 
   end 
end 
function createSpawnWindow(hitPlayer) 
    if hitPlayer == localPlayer then     
       windowSpawncar = guiCreateWindow(0.36, 0.70, 0.26, 0.29, "", true) 
       guiWindowSetSizable(windowSpawncar, false) 
       btnSancheZ = guiCreateButton(0.05, 0.12, 0.87, 0.14, "1: Sanchez", true, windowSpawncar) 
       local font0_PetitFormalScript = guiCreateFont(":guieditor/fonts/PetitFormalScript.ttf", 10) 
       guiSetFont(btnSancheZ, font0_PetitFormalScript) 
       guiSetProperty(btnSancheZ, "NormalTextColour", "FFFFFFFF") 
       btnVoodoo = guiCreateButton(0.05, 0.39, 0.87, 0.14, "2: Voodoo", true, windowSpawncar) 
       guiSetFont(btnVoodoo, font0_PetitFormalScript) 
       guiSetProperty(btnVoodoo, "NormalTextColour", "FFFFFFFF") 
       btnCaddy = guiCreateButton(0.06, 0.67, 0.86, 0.14, "3: Caddy", true, windowSpawncar) 
       guiSetFont(btnCaddy, font0_PetitFormalScript) 
       guiSetProperty(btnCaddy, "NormalTextColour", "FFFFFFFF")     
       guiSetVisible( windowSpawncar, true ) 
   end 
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
addEventHandler( "onClientMarkerHit", getRootElement(), createSpawnWindow) 

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