pickup chieckpoint gui

Started by gtacheng, May 10, 2019, 05:22 AM

Previous topic - Next topic

gtacheng

Enter Pickup Card and Checkpoint Display Gui


gtacheng

I want to implement it on my server, but I don't know how to implement it. Can you tell me?

NicusorN5


Luis_Labarca

#3
Quote from: GTA-Cheng on May 10, 2019, 05:22 AMEnter Pickup Card and Checkpoint Display Gui


Hello friend, I hope and this works for you

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

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


///--- 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 RP
IP: 51.222.28.159:8194

=RK=MarineForce

can you tell me how can i add spirites and custom mapicons @luis

Kelvinvenema

Quote from: =RK=MarineForce on Jul 28, 2019, 09:41 PMcan you tell me how can i add spirites and custom mapicons @luis

I may be a bit late, but I could help you with creating custom map icons, first of all, create an icon you like or download your icon you like.
Secondly, you have to put this picture/icon at its destination, the locating is located at /where your server is then, you locate map store, and look for the map with the name mapicons but it in there, and name your icon/picture
 m100_YourIconName.png
the reason why we use 100 because lower than 100 there are already icons. Adding new icons goes from id 100.
after that, you have to create your custom icon in your script if you haven't renamed it should be named main.nut
you create a map icon by using this syntax:

<CreateMarker > // Just the function name
(1, <The world > // by default it is 0
<Vector(),> //  the location where you want it using x, y, and z coordination
1,  < Size > (the size of the picture/icon by default it is mostly 4 or 5)  // trying figuring out which one you need.
RGB <RGB( R, G, B),> // don't be confused about the R, G, B you can find the color is liked on google if you RGB color codes you will probably find it.
100); <mapicon id> // Note less than hundred aren't custom once, those ids already exist use 100 and beyond, don't forget to use the id from your map icon/picture you like those ids numbers should be the same, at the end it should like something like this
CreateMarker(1, Vector( -1438.25,-777.969, 14.8701 ), 1, RGB(216, 241, 0),100);
 I hope this was informative and sorry for the late comment.