I need Some Commands

Rardodus Bruise

  • Newbie
  • The Slasto Family
  • Posts: 13
I need Some Commands
«  »
/help ( I have that but i want to open another screen) I dont know to open another screen and Say What ever i want in this cmd .

/location that tells where we are in X , Y , Z to add pickups and Things

 Can someone give me shop system . I mean if we type /buy it takes to another screen and shows the item of thing that we add by using /additem (ID Number) and i want /remitem too . That we can buy aswell
With the pickups .
 
Thanks!

Xhefri

  • Newbie
  • Posts: 16
Re: I need Some Commands
« Reply #1,  »
I made this shop system to buy guns
I am not sure if this will work because it can have some errors since i did not test it.
Code: [Select]
function onClientScriptData(player)
{
 local string = Stream.ReadString(), int = Stream.ReadInt();
     if(string == "set1")
  {
  if (player.Cash < 1000 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy M4", player );
  else{
  player.SetWeapon(26 ,500)
  MessagePlayer( "[#FF4500]You have bought M4", player );
  }
  }
  else if (string == "set2")
  {
  if (player.Cash < 800 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy Shotgun #1", player );
  else{
  player.SetWeapon( 21, 70 );
  MessagePlayer( "[#FF4500]You have bought Shotgun #1", player );
  }
  }
  else if (string == "set3")
  {
  if (player.Cash < 700 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy Shotgun #2", player );
  else{
   player.SetWeapon(19 ,70)
   DecCash(player, 700);
   MessagePlayer( "[#FF4500]You have bought Shotgun #2", player );
  }
  }
  else if (string == "set4")
  {
  if (player.Cash < 300 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy MP5", player );
  else{
   player.SetWeapon(25 ,200)
   MessagePlayer( "[#FF4500]You have bought MP5", player );
   DecCash(player, 300);
  }
  }
  else if (string == "set5")
  {
  if (player.Cash < 1000 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy Ruger", player );
  else{
   player.SetWeapon(27 ,500)
   DecCash(player, 1000);
   MessagePlayer( "[#FF4500]You have bought Ruger", player );
  }
  }
  else if (string == "set6")
  {
  if (player.Cash < 1500 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy Sniper", player );
  else{
   player.SetWeapon(28 ,200) 
   DecCash(player, 1500);
   MessagePlayer( "[#FF4500]You have bought Sniper", player );
  }
  }
  else if (string == "set7")
  {
  if (player.Cash < 300 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy Uzi", player );
  else{
   player.SetWeapon(23 ,200)
   MessagePlayer( "[#FF4500]You have bought Uzi", player );
  }
  }
  else if (string == "set8")
  {
  if (player.Cash < 300 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy Python", player );
  else{
   player.SetWeapon(18 ,70)
   MessagePlayer( "[#FF4500]You have bought Python", player );
  }
  }
  else if (string == "set9")
  {
  if (player.Cash < 50 ) MessagePlayer( "[#FF4500]You dont have enough cash to buy Grenade", player );
  else{
   player.SetWeapon(12 ,1)
   MessagePlayer( "[#FF4500]You have bought Grenade", player );
   }
  }
   else if (string == "set10")
  {
  local p = FindPlayer( player )
  Stream.StartWrite()
  Stream.WriteInt(2)
  Stream.SendStream(p)
  }
}


Code: [Select]
else if ( cmd == "testxhefcom" )
  {
     Stream.StartWrite()
  Stream.WriteInt(1)
  Stream.SendStream(player)
  }


Client - side

Code: [Select]
sX <- GUI.GetScreenSize().X;
sY <- GUI.GetScreenSize().Y;

function Script::ScriptLoad()
{
    Console.Print("Client-Side Loaded")
}


function Server::ServerData( stream )
{
    local strint = stream.ReadInt( );
 
    switch( strint.tointeger( ) )
    {
        case 1:
                ::GUI.SetMouseEnabled(true);
                ::Table <- GUIProgressBar( VectorScreen(sX * 0.33, sY * 0.10), VectorScreen(sX * 0.29, sY * 0.40),  Colour(0, 0, 0, 180));
                ::Table.AddFlags( GUI_FLAG_BORDER | GUI_FLAG_ANIMATION | GUI_FLAG_TABSTOP );
                ::Table.Colour = Colour(0, 0, 0, 180);
                ::Set1 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.10), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy  M4 ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set2 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.14), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy Shotgun #1 ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set3 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.18), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy Shotgun #2 ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set4 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.22), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy MP5 ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set5 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.26), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy Ruger ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set6 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.30), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy Sniper ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set7 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.34), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy Uzi ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set8 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.38), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy Python ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
::Set9 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.42), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "Buy Grenade ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
                ::Set10 <- GUIButton(VectorScreen(sX * 0.35, sY * 0.46), VectorScreen(sX * 0.25, sY * 0.04), Colour(0, 0, 0, 180), "EXIT MENU ", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
::Set1.TextColour = Colour(255, 255, 250);
                ::Set2.TextColour = Colour(255, 255, 250);
                ::Set3.TextColour = Colour(255, 255, 250);
                ::Set4.TextColour = Colour(255, 255, 250);
                ::Set5.TextColour = Colour(255, 255, 250);
                ::Set6.TextColour = Colour(255, 255, 250);
                ::Set7.TextColour = Colour(255, 255, 250);
                ::Set8.TextColour = Colour(255, 255, 250);
                ::Set9.TextColour = Colour(255, 255, 250);
::Set10.TextColour = Colour(255, 255, 250);
        break;
        case 2:
                ::Table <- null;
                ::Set1 <- null;
                ::Set2 <- null;
                ::Set3 <- null;
                ::Set4 <- null;
                ::Set5 <- null;
                ::Set6 <- null;
                ::Set7 <- null;
                ::Set8 <- null;
::Set9 <- null;
::Set10 <- null;
                ::GUI.SetMouseEnabled(false);
        break;
       default: break;
    }
}

function GUI::ElementClick(element, mouseX, mouseY)
{
if ( element == Table )
{
Console.Print("[#A22ACC][M4] [#AC2211]Done")
}
    else if (element == Set1)
    {
        local Data = Stream();
        Data.WriteString("set1");
        Server.SendData(Data);

    }
    else if(element == Set2)
    {
        local Data = Stream();
        Data.WriteString("set2");
        Server.SendData(Data);
    }
    else if(element == Set3)
    {
        local Data = Stream();
        Data.WriteString("set3");
        Server.SendData(Data);
    }
    else if(element == Set4)
    {
        local Data = Stream();
        Data.WriteString("set4");
        Server.SendData(Data);
    }
    else if(element == Set5)
    {
        local Data = Stream();
        Data.WriteString("set5");
        Server.SendData(Data);
    }
    else if(element == Set6)
    {
        local Data = Stream();
        Data.WriteString("set6");
        Server.SendData(Data);
    }
    else if(element == Set7)
    {
        local Data = Stream();
        Data.WriteString("set7");
        Server.SendData(Data);
    }
    else if(element == Set8)
    {
        local Data = Stream();
        Data.WriteString("set8");
        Server.SendData(Data);
    }
else if(element == Set9)
    {
        local Data = Stream();
        Data.WriteString("set9");
        Server.SendData(Data);
    }
else if(element == Set10)
    {
        local Data = Stream();
        Data.WriteString("set10");
        Server.SendData(Data);
    }
}


Dont forget to add your money system so it can decreace the money when some one buy a gun

Rardodus Bruise

  • Newbie
  • The Slasto Family
  • Posts: 13

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 335