Xeno Posted April 10, 2010 Share Posted April 10, 2010 I have two questions for you guys today . 1. What is the F1 Gui called in the reasouce folder? 2. What is rong with this code, its an error and the gui does not come up. Heres my script gMe = getLocalPlayer () function privateclans() wdwLogin = guiCreateWindow(226,146,372,233,"[PEDS]",false) guiWindowSetMovable(wdwLogin,false) guiWindowSetSizable(wdwLogin,false) tabpanel = guiCreateTabPanel(0.0242,0.0858,0.9489,0.8755,true,wdwLogin) tab1 = guiCreateTab("[OPTIONS]",tabpanel) makeped = guiCreateButton(0.010,0.100,0.200,0.200,"CreatePed",true,tab1) givem4 = guiCreateButton(0.210,0.100,0.200,0.200,"GiveM4",true,tab1) Dance = guiCreateButton(0.410,0.100,0.200,0.200,"Dance",true,tab1) Aim = guiCreateButton(0.610,0.100,0.200,0.200,"Aim gun",true,tab1) Fire= guiCreateButton(0.810, 0.100,0.200,0.200"Fire gun",true,tab1) tab2 = guiCreateTab("[iNFO]",tabpanel) information = guiCreateButton(0.010,0.100,0.970,0.800,"|This Was all made by Tomdrum11|",true,tab2) bindKey("F3" , "down" , windowToggle) end function windowToggle() if (guiGetVisible(wdwLogin) == true) then guiSetVisible(wdwLogin, false) showCursor(false) elseif (guiGetVisible(wdwLogin) == false) then guiSetVisible(wdwLogin, true) showCursor(true) end end function test() if source == makeped then createPed(164,0,0,6) outputChatBox("Your ped has been created!!", gMe) end addEventHandler("onClientGUIClick",makeped,clientSubmitLogin,false) addEventHandler( "onClientResourceStart" , getResourceRootElement(getThisResource()), privateclans) the script is ment to be a ped gui, so you can like create a ped and make him get a gun and fire and stuff. Link to comment
Gamesnert Posted April 10, 2010 Share Posted April 10, 2010 1. Freeroam 2. Please add more info about the error, although I presume it's the fact you're missing an "end" after function "test" Link to comment
Xeno Posted April 10, 2010 Author Share Posted April 10, 2010 gMe = getLocalPlayer () function privateclans() wdwLogin = guiCreateWindow(226,146,372,233,"[PEDS]",false) guiWindowSetMovable(wdwLogin,false) guiWindowSetSizable(wdwLogin,false) tabpanel = guiCreateTabPanel(0.0242,0.0858,0.9489,0.8755,true,wdwLogin) tab1 = guiCreateTab("[OPTIONS]",tabpanel) makeped = guiCreateButton(0.010,0.100,0.200,0.200,"CreatePed",true,tab1) givem4 = guiCreateButton(0.210,0.100,0.200,0.200,"GiveM4",true,tab1) Dance = guiCreateButton(0.410,0.100,0.200,0.200,"Dance",true,tab1) Aim = guiCreateButton(0.610,0.100,0.200,0.200,"Aim gun",true,tab1) tab2 = guiCreateTab("[iNFO]",tabpanel) information = guiCreateButton(0.010,0.100,0.970,0.800,"|This Was all made by Tomdrum11|",true,tab2) bindKey("F3" , "down" , windowToggle) end function windowToggle() if (guiGetVisible(wdwLogin) == true) then guiSetVisible(wdwLogin, false) showCursor(false) elseif (guiGetVisible(wdwLogin) == false) then guiSetVisible(wdwLogin, true) showCursor(true) end end function test() if source == makeped then createPed(164,0,0,6) outputChatBox("Your ped has been created!!", gMe) end end addEventHandler("onClientGUIClick",makeped,clientSubmitLogin,false) addEventHandler( "onClientResourceStart" , getResourceRootElement(getThisResource()), privateclans) ok here it is now. now it says in debugscript 3, :"Atempted to call globe getLocalPlayer(a nil value) what does this mean Link to comment
dzek (varez) Posted April 10, 2010 Share Posted April 10, 2010 this is client side script, and you are set it server side i think.. Link to comment
Xeno Posted April 10, 2010 Author Share Posted April 10, 2010 no i want it so other people cannot see other peds or people will spam up the server Link to comment
Gamesnert Posted April 10, 2010 Share Posted April 10, 2010 no i want it so other people cannot see other peds or people will spam up the server He meant that you most likely put the script server-side instead of client-side. Link to comment
Xeno Posted April 10, 2010 Author Share Posted April 10, 2010 But then i would have to change it all? Link to comment
50p Posted April 10, 2010 Share Posted April 10, 2010 But then i would have to change it all? Tell server that this file in a client-side file... Check the Meta.xml page (link in my signature) Link to comment
Xeno Posted April 10, 2010 Author Share Posted April 10, 2010 No iv done all that <meta> <info author="tomdrum11" type="script" name="" description="" /> <script src="scriptclient.lua" type="client" /> <script src="scriptserver.lua" type="server" /> </meta> so if i was to put some of it in client how would i like them, heres my server side now function test() if source == makeped then createPed(164,0,0,6) outputChatBox("Your ped has been created!!", gMe) end end addEventHandler("onClientGUIClick",makeped,clientSubmitLogin,false) Link to comment
50p Posted April 10, 2010 Share Posted April 10, 2010 No iv done all that <meta> <info author="tomdrum11" type="script" name="" description="" /> <script src="scriptclient.lua" type="client" /> <script src="scriptserver.lua" type="server" /> </meta> so if i was to put some of it in client how would i like them, heres my server side now function test() if source == makeped then createPed(164,0,0,6) outputChatBox("Your ped has been created!!", gMe) end end addEventHandler("onClientGUIClick",makeped,clientSubmitLogin,false) You can't use client-side functions/events inside server-side script! onClientGUIClick is a client event which you can't use in server-side script. Link to comment
Xeno Posted April 10, 2010 Author Share Posted April 10, 2010 EDIT Nm i figured, i got quite far, but now i have no idea wat i change this addEventHandler, everything else seems to be fine, this is the script function createped () triggerServerEvent ( "onClientGUIClick", getLocalPlayer(), "Hello World!" ) end addEventHandler("onClientGUIClick",clientSubmitLogin,false) and that links to function test() createPed(164,0,0,6) end end addEvent( "onClientGUIClick", true ) addEventHandler( "onClientGUIClick", getRootElement(), test ) Link to comment
dzek (varez) Posted April 10, 2010 Share Posted April 10, 2010 why ppl are trying to script via copying and pasting random examples, and dont even try to understand that? im giving up in this topic .. Link to comment
Xeno Posted April 10, 2010 Author Share Posted April 10, 2010 i do understand it ?it just that server trigger i need to change the hello world to somthing i dont no , and i need to no how to do the addEventHandler. and tbh you cant say that you did do that when you were learning . Link to comment
dzek (varez) Posted April 10, 2010 Share Posted April 10, 2010 if you are creating custom events dont name it same as existing ones.. i know that i copied some examples from wiki, but i was changing them a lot, or re-writing at all, and i was trying to get to know how it is working, why i have to do something in that way, and not any other way etc etc. remove that "hello world" you dont need it, and you have one "end" too much in the server part.. 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