DIR Return Create A Forum - Home
---------------------------------------------------------
Community of International Gameplay
HTML https://cigserver.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Scripting
*****************************************************
#Post#: 324--------------------------------------------------
Tutorial how to make a Information client
By: leonidas Date: August 8, 2012, 10:52 pm
---------------------------------------------------------
Today i will show you how to make a simple Information client
first, you need to make the XML documents like : The Rules, The
Commands, etc:
[code]local rulesContent = nil
local commandsContent = nil
local othersContent = nil
local rulesXML = xmlLoadFile( "rules.xml" )
if ( rulesXML ) then
rulesContent = xmlNodeGetValue( rulesXML )
if ( rulesContent ) then
rulesContent = rulesContent
else
rulesContent = "Error loading XML file"
end
end
local commandsXML = xmlLoadFile( "commands.xml" )
if ( commandsXML ) then
commandsContent = xmlNodeGetValue( commandsXML )
if ( commandsContent ) then
commandsContent = commandsContent
else
commandsContent = "Error loading XML file"
end
end
local newsXML = xmlLoadFile( "news.xml" )
if ( newsXML ) then
othersContent = xmlNodeGetValue( newsXML )
if ( othersContent ) then
othersContent = othersContent
else
othersContent = "Error loading XML file"
end
end
[/code]
remember make the XML document.. like :
[code]<content>
Function key binds:
1. F1 - Information screen with the rules and information about
thing in the server
</content>[/code]
its commands.xml
Second : create the gui :
[code]informationWindow =
guiCreateWindow(200,200,649,600,"GOD=(Server)-
Information",false)
informationTabPanel =
guiCreateTabPanel(11,24,627,510,false,informationWindow)
rulesTab = guiCreateTab("Server rules",informationTabPanel)
rulesMemo =
guiCreateMemo(3,4,622,465,rulesContent,false,rulesTab)
guiMemoSetReadOnly(rulesMemo,true)
commandsTab = guiCreateTab("Commands and
binds",informationTabPanel)
commandsMemo =
guiCreateMemo(3,4,622,465,commandsContent,false,commandsTab)
guiMemoSetReadOnly(commandsMemo,true)
jobsTab = guiCreateTab("Job information",informationTabPanel)
jobsMemo = guiCreateMemo(3,4,622,465,jobsContent,false,jobsTab)
guiMemoSetReadOnly(jobsMemo,true)
othersTab = guiCreateTab("News",informationTabPanel)
othersMemo =
guiCreateMemo(3,4,622,465,othersContent,false,othersTab)
guiMemoSetReadOnly(othersMemo,true)
languangeButton = guiCreateButton(23,542,265,38,"Indonesian
Languange",false,informationWindow)
local screenW,screenH=guiGetScreenSize()
local windowW,windowH=guiGetSize(informationWindow,false)
local x,y = (screenW-windowW)/2,(screenH-windowH)/2
guiSetPosition(informationWindow,x,y,false)
guiWindowSetMovable (informationWindow, false)
guiWindowSetSizable (informationWindow, false)
guiSetVisible (informationWindow, false)[/code]
Third.. make the gui function
[code]function showF1Gui ()
if guiGetVisible(informationWindow) then
guiSetVisible(informationWindow, false)
showCursor(false,false)
else
guiSetVisible(informationWindow,true)
showCursor(true,true)
guiSetInputMode("no_binds_when_editing")
end
end[/code]
and last, make the bind keys.
[code]bindKey ( "F1", "down", showF1Gui )[/code]
i made it F1.. why? coz i can.. ;)
sowwie for my bad inglesh 8)
#Post#: 335--------------------------------------------------
Re: Tutorial how to make a Information client
By: powder Date: August 9, 2012, 2:10 am
---------------------------------------------------------
Hmm... i see you got some scripting skills... we gota talk ;)
#Post#: 343--------------------------------------------------
Re: Tutorial how to make a Information client
By: vanilla66 Date: August 9, 2012, 3:46 am
---------------------------------------------------------
Nice one Leo :D thanks for Tutorial i want to know about it to0
:D can you teach some
#Post#: 383--------------------------------------------------
Re: Tutorial how to make a Information client
By: leonidas Date: August 10, 2012, 3:09 am
---------------------------------------------------------
sure @noctis..
i also know how to made the Job script, Pay'n'Spray
*****************************************************