Haze Posted September 10, 2011 Share Posted September 10, 2011 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 ) Link to comment
Jaysds1 Posted September 10, 2011 Share Posted September 10, 2011 so instead of outputing it to the Chat box, you want it to be in a GUI Text with no gui showing? Link to comment
bandi94 Posted September 10, 2011 Share Posted September 10, 2011 guiCreateWindow guiCreateMemo guiMemoSetReadOnly guiCreateButton showCursor guiSetVisible "onClientGUIClick" Link to comment
Haze Posted September 10, 2011 Author Share Posted September 10, 2011 Yeh instead of outPutChatBox i want it Us GUI Text Link to comment
Jaysds1 Posted September 10, 2011 Share Posted September 10, 2011 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 ) Link to comment
Haze Posted September 10, 2011 Author Share Posted September 10, 2011 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 ) Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 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) Link to comment
Benevolence Posted September 10, 2011 Share Posted September 10, 2011 Haze use [ lua]code[/lua] not [ code]code[/code] Link to comment
JR10 Posted September 10, 2011 Share Posted September 10, 2011 Kinda like exactly what Cast said, right? No need for useless posts. Link to comment
Haze Posted September 10, 2011 Author Share Posted September 10, 2011 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 Link to comment
Haze Posted September 10, 2011 Author Share Posted September 10, 2011 Hey Solide The im going to Set Timer for Script its Clinet or Server Side Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 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". Link to comment
Haze Posted September 10, 2011 Author Share Posted September 10, 2011 no dud i just asked u about SetTimer Function is it A Client or Server dud Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 setTimer can be used in client and server side, if you would take a look in the wiki before asking, it's very understable. https://wiki.multitheftauto.com/wiki/SetTimer Says: Client And Server function. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now