Jump to content

Help with some things


Xeno

Recommended Posts

Posted

I have two questions for you guys today :P.

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.

Posted

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

Posted

this is client side script, and you are set it server side i think..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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)

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

Posted

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 )

Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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 .

Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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