Jump to content

GUI An


Haze

Recommended Posts

Posted

Hello EveryOne Today i Have this script and i Try to Make The Words on the OutputChatBox Look On Small GUI Announce I use a lot of Commands and Functions but it didnt Work i dont Know why :(

Im going to Post the Code Plz Help me to Make the Words on OutputChatBox Look Us GUI Text And Thank you :)

local vehicle1 =createVehicle ( 520, 302.74, 1818.85, 17.64) 
  
ArmyVehicles  ={[vehicle1]=true} 
ArmyTeam = { ["Army"]=true } 
  
function ArmyenterVehicle ( player, seat, jacked ) 
local team = getPlayerTeam(player) 
    if ( ArmyVehicles[source] ) and ( not ArmyTeam[getTeamName ( team )] )  then 
        cancelEvent() 
        outputChatBox ( "You aren't an Army Member , you mayn't drive this.", player ) --and tell the player why 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), ArmyenterVehicle ) 

Ingame nick: FWC>Haze

Server I play: FWCentral

Job: FWCentral Developer

Website: fwcentral.net

276473_205836092791903_297368_n.jpg

default.png?k=0e33bf78535ebcd5e63c863cd33516c6&10966802

default.png?k=557262ebc578ba0f5fbb0b9176e6820e&10966803

Posted
guiCreateWindow 
guiCreateMemo 
guiMemoSetReadOnly 
guiCreateButton 
showCursor 
guiSetVisible 
 "onClientGUIClick" 
  

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

Yeh instead of outPutChatBox i want it Us GUI :) Text

Ingame nick: FWC>Haze

Server I play: FWCentral

Job: FWCentral Developer

Website: fwcentral.net

276473_205836092791903_297368_n.jpg

default.png?k=0e33bf78535ebcd5e63c863cd33516c6&10966802

default.png?k=557262ebc578ba0f5fbb0b9176e6820e&10966803

Posted

use:

guiCreateLabel( float x, float y, float width, float height, "You aren't an Army Member , you mayn't drive this.", bool relative) 

this is how it should look:

local vehicle1 =createVehicle ( 520, 302.74, 1818.85, 17.64) 
  
ArmyVehicles  ={[vehicle1]=true} 
ArmyTeam = { ["Army"]=true } 
  
function ArmyenterVehicle ( player, seat, jacked ) 
local team = getPlayerTeam(player) 
    if ( ArmyVehicles[source] ) and ( not ArmyTeam[getTeamName ( team )] )  then 
        cancelEvent() 
        guiCreateLabel( float x, float y, float width, float height, "You aren't an Army Member , you mayn't drive this.", bool relative) --and tell the player why 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), ArmyenterVehicle ) 

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

HI ALL I TRY TO MAKE THIS ONE GUI THINK And its not working the An For Hydra in GUI its not working

local vehicle1 =createVehicle ( 520, 302.74, 1818.85, 17.64) 
  
ArmyVehicles  ={[vehicle1]=true} 
ArmyTeam = { ["Army"]=true } 
  
function ArmyenterVehicle ( player, seat, jacked ) 
local team = getPlayerTeam(player) 
    if ( ArmyVehicles[source] ) and ( not ArmyTeam[getTeamName ( team )] )  then 
        cancelEvent() 
        guiCreateLabel( 402, 271, 255, 47, "You aren't an Army Member , you mayn't drive this.", false) --and tell the player why 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), ArmyenterVehicle ) 

Ingame nick: FWC>Haze

Server I play: FWCentral

Job: FWCentral Developer

Website: fwcentral.net

276473_205836092791903_297368_n.jpg

default.png?k=0e33bf78535ebcd5e63c863cd33516c6&10966802

default.png?k=557262ebc578ba0f5fbb0b9176e6820e&10966803

Posted

Firstly, use the LUA tags.

Second, guiCreateLabel is client side ONLY, and your event handler is server side, so, you need a event triggered to client.

-- server side

local vehicle1 =createVehicle ( 520, 302.74, 1818.85, 17.64) 
  
ArmyVehicles  ={[vehicle1]=true} 
ArmyTeam = { ["Army"]=true } 
  
function ArmyenterVehicle ( player, seat, jacked ) 
local team = getPlayerTeam(player) 
    if ( ArmyVehicles[source] ) and ( not ArmyTeam[getTeamName ( team )] )  then 
        triggerClientEvent(player,"showErrorLabel",player) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), ArmyenterVehicle ) 
  

-- client side

addEvent("showErrorLabel",true) 
addEventHandler("showErrorLabel",root, 
function () 
      if errorLabel then destroyElement(errorLabel) end 
      errorLabel =  guiCreateLabel( 402, 271, 255, 47, "You aren't an Army Member , you mayn't drive this.", false) 
end) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thank everyone and this Forum is Really Good If i have Problem i will always ask for your Help And Ty For LUA i will Use the LUA Tags Next :)

Ingame nick: FWC>Haze

Server I play: FWCentral

Job: FWCentral Developer

Website: fwcentral.net

276473_205836092791903_297368_n.jpg

default.png?k=0e33bf78535ebcd5e63c863cd33516c6&10966802

default.png?k=557262ebc578ba0f5fbb0b9176e6820e&10966803

Posted

Hey Solide The im going to Set Timer for Script its Clinet or Server Side

Ingame nick: FWC>Haze

Server I play: FWCentral

Job: FWCentral Developer

Website: fwcentral.net

276473_205836092791903_297368_n.jpg

default.png?k=0e33bf78535ebcd5e63c863cd33516c6&10966802

default.png?k=557262ebc578ba0f5fbb0b9176e6820e&10966803

Posted

What? the one which says client side has to be type="client" in meta.xml, and the one which says server side has to be type="server".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

no dud i just asked u about SetTimer Function is it A Client or Server dud

Ingame nick: FWC>Haze

Server I play: FWCentral

Job: FWCentral Developer

Website: fwcentral.net

276473_205836092791903_297368_n.jpg

default.png?k=0e33bf78535ebcd5e63c863cd33516c6&10966802

default.png?k=557262ebc578ba0f5fbb0b9176e6820e&10966803

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