1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

What client side?

Discussion in 'Archive' started by Syafiq, Mar 29, 2017.

  1. Syafiq

    Syafiq Member

    Messages:
    10
    Likes Received:
    0
    Joined:
    Mar 29, 2017
    I am really lost and have no idea what client side you guys are referring to. In my visual basic library, i insert in the stant using gtanetworkshared and the exe it self. What client are you guys referring to?
     
  2. -Andreas

    -Andreas Well-Known Member

    Messages:
    172
    Likes Received:
    25
    Joined:
    Sep 29, 2016
    A GTA:Network server consists of two components.
    The client side which contains the javascripts.
    The server side which contains the C# scripts.

    When ever a client connects to your server he will be required to download what ever scripts you have written in the langauge javascript if you define them as the type of client in your metafile. These scripts will run on the client machines whereas the C# scripts will be handled by the server itself.
     
  3. Syafiq

    Syafiq Member

    Messages:
    10
    Likes Received:
    0
    Joined:
    Mar 29, 2017
    I am not a
    I am not able to the API.Drawtext . When i search on wiki, it says about client side. What am i suppose to do to be able to make text show up on my script? Basically for player GUI.
     
  4. -Andreas

    -Andreas Well-Known Member

    Messages:
    172
    Likes Received:
    25
    Joined:
    Sep 29, 2016
    So you're having issues with your script? It's
    API.drawText not API.Drawtext. Anyway did you remember to do it inside the onUpdate scope? Try to show your code if you want help. I find it hard to understand what you're talking about to be honest.
     
  5. Syafiq

    Syafiq Member

    Messages:
    10
    Likes Received:
    0
    Joined:
    Mar 29, 2017
    I'm usi

    i am using visual basic and i do not have the DrawText option after i put API. bla bla bla.. Whenever i type API.D.... there is only getPlayerAccesoryDrawable & getPlayerClothesDrawable..


    -----------------------
    This is my code

    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using GTANetworkServer;
    using GTANetworkShared;

    namespace newcommands
    {
    public class newcommands : Script
    {

    public void Main()
    {
    API.onUpdate += OnUpdateHandler;

    }
    public void OnUpdateHandler()
    {
    // Where i plan to insert.

    }
    public newcommands()
    {
    API.onPlayerConnected += OnPlayerConnected;
    API.createCylinderColShape(new Vector3(-830.1246, -2514.488, 13.83052), 2.0f, 3.0f);

    }

    [Command("weapon")]

    public void weapon(Client player, WeaponHash weapon)
    {
    API.givePlayerWeapon(player, weapon, 9900, true, true);
    }
    [Command("car")]
    public void car(Client player, VehicleHash vehicle)
    {
    Vector3 playerPos = API.getEntityPosition(player);
    Vector3 playerRot = API.getEntityRotation(player);
    API.createVehicle(vehicle, playerPos, playerRot, 0, 0, 0);
    API.createTextLabel("Hello its me",playerPos,3f,4f,true,0);
    API.createMarker(0, playerPos, new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(1, 1, 1), 255, 0, 255, 0, 0);
    }

    the code continues.....
     
  6. -Andreas

    -Andreas Well-Known Member

    Messages:
    172
    Likes Received:
    25
    Joined:
    Sep 29, 2016
    I'm going to guess it's because you're trying to use the API.drawText on a C# script while the API function is only for client sided scripts like javascripts.
     
  7. Hansrutger

    Hansrutger Well-Known Member Donator

    Messages:
    114
    Likes Received:
    36
    Joined:
    Mar 4, 2017

Share This Page