pickup chieckpoint gui

GTA-Cheng

  • Newbie
  • Posts: 15
Re: pickup chieckpoint gui
« Reply #1,  »
I want to implement it on my server, but I don't know how to implement it. Can you tell me?

Athanatos

  • Hero Member
  • Romania Cops N Robbers Lead Developer
  • Posts: 812

Luis_Labarca

  • Sr. Member
  • Hello :D
  • Posts: 300
Re: pickup chieckpoint gui
« Reply #3,  »Last edited
Quote from GTA-Cheng on May 10th, 06:22 AM
Enter Pickup Card and Checkpoint Display Gui
Hello friend, I hope and this works for you

add on your server, Server/Script/main.nut

Code: [Select]
function onCheckpointEntered(player, checkpoint)
{
if( checkpoint.ID == 0)
{
Stream.StartWrite()
Stream.WriteString("Checkpoint1")
Stream.SendStream(player)
}
}
function onClientScriptData(player)
{
local ReadString = Stream.ReadString();
local ReadNum = Stream.ReadInt();

if( ReadString == "AcceptChecpoint")
{
//Add you function
//Add you function
//Add you function
//Add you function
Stream.StartWrite()
Stream.WriteString("DeletMenuCheckpoint")
Stream.SendStream(player)
}
if( ReadString == "CloseCheckpoint")
{
Stream.StartWrite()
Stream.WriteString("DeletMenuCheckpoint")
Stream.SendStream(player)
}
}




Add in the store -- /Store/tu script


Code: [Select]
///--- Tables
CheckpointAndGUI <- null;
AcceptChecpoint <- null;
CloseCheckpoint <- null;
ScreenX <- GUI.GetScreenSize().X;
ScreenY <- GUI.GetScreenSize().Y;
Size <- ScreenY / 40;

function Server::ServerData(stream)
{
local ReadStrind = stream.ReadString();
if(ReadString=="Checkpoint1")
{
::GUI.SetMouseEnabled(true);
::CheckpointAndGUI <- GUIMemobox( VectorScreen(( ScreenX * 0.50 ) - ( ScreenY / Size), ScreenY * 0.40),VectorScreen(220, 110), Colour(20, 20, 20), GUI_FLAG_MEMOBOX_TOPBOTTOM | GUI_FLAG_VISIBLE);
::CheckpointAndGUI.TextColour = Colour(255, 255, 255);
::CheckpointAndGUI.Alpha=200;
::CheckpointAndGUI.FontName = "Tahoma";
::CheckpointAndGUI.FontSize = 10;
::CheckpointAndGUI.AddFlags(GUI_FLAG_TEXT_TAGS | GUI_FLAG_SCROLLABLE | GUI_FLAG_SCROLLBAR_HORIZ);
::CheckpointAndGUI.TextPaddingTop = 10;
::CheckpointAndGUI.TextPaddingBottom = 4;
::CheckpointAndGUI.TextPaddingLeft = 10;
::CheckpointAndGUI.TextPaddingRight = 10;
::CheckpointAndGUI.AddLine("------- Menu -------");
::CheckpointAndGUI.AddLine("Checkpoint and GUI");
//--------
::AcceptChecpoint <- GUIButton(VectorScreen(30,65), VectorScreen(50, 22), Colour(75,75,75), "Acept", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
::AcceptChecpoint.TextColour = Colour(255, 255, 255);
::AcceptChecpoint.FontName =  "Tahoma";
::AcceptChecpoint.FontSize = 10;
::AcceptChecpoint.Alpha=180;
//--------
::CloseCheckpoint <- GUIButton(VectorScreen(120,65), VectorScreen(50, 22), Colour(75,75,75), "Close", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
::CloseCheckpoint.TextColour = Colour(255, 255, 255);
::CloseCheckpoint.FontName =  "Tahoma";
::CloseCheckpoint.FontSize = 10;
::CloseCheckpoint.Alpha=180;
//--
::CheckpointAndGUI.AddChild(CloseCheckpoint);
::CheckpointAndGUI.AddChild(AcceptChecpoint);
}
////--- Delet GUI checkpoint
if(ReadString=="DeletMenuCheckpoint")
{
::GUI.SetMouseEnabled(false);
::CheckpointAndGUI <- null;
::AcceptChecpoint <- null;
::CloseCheckpoint <- null;
}
}
function GUI::ElementClick(element, mouseX, mouseY)
{
if(element == ::AcceptChecpoint)
{
local Dates = Stream();
Dates.WriteString("AcceptChecpoint");
Server.SendData(Dates);
}
if(element == ::CloseCheckpoint)
{
local Dates = Stream();
Dates.WriteString("CloseCheckpoint");
Server.SendData(Dates);
}
}

function Script::ScriptProcess()
{
::ScreenX = GUI.GetScreenSize().X;
::ScreenY = GUI.GetScreenSize().Y;
if(::CheckpointAndGUI)
{
::CheckpointAndGUI.Position = ::VectorScreen(( ScreenX * 0.30 ) - ( ScreenY / Size), ScreenY * 0.400)
}
}



My server ...:: RPG ::...
IP: 149.56.143.129:8195

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 448
Re: pickup chieckpoint gui
« Reply #4,  »
can you tell me how can i add spirites and custom mapicons @luis
Try to UnderStand ME!