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.

Literature

Discussion in 'Scripting Help' started by s2s.k, May 7, 2017.

  1. s2s.k

    s2s.k Member

    Messages:
    16
    Likes Received:
    0
    Joined:
    May 7, 2017
    Tell me what literature to read on the C # language? And yet, in addition, is it correct to write the whole project absolutely in C # without affecting the JS?

    Thank you all.
     
  2. TheSup

    TheSup Active Member

    Messages:
    79
    Likes Received:
    10
    Joined:
    Apr 18, 2017
    Read the Basics of c#. Syntax and Class Type comparison...
    You won't be able to write the script without any js (Roleplay)
     
  3. -Andreas

    -Andreas Well-Known Member

    Messages:
    172
    Likes Received:
    25
    Joined:
    Sep 29, 2016
    Just try to search on Google for literature, but here's two Youtube channels that actually provides a good explaination on the C# topic.
    https://www.youtube.com/playlist?list=PLylgIRlJtHWT6iB_c_sumeqIEYJ5GWZqd
    https://www.youtube.com/playlist?list=PLbghT7MmckI7JAftgv0CUdU4RLNivG6wY
    There's one link provided on the wikipage regarding literature, but it's not something I've looked into myself.
    https://msdn.microsoft.com/en-us/library/aa288436(v=vs.71).aspx

    And no. You must likely wont be able to make any gamemode without touching the client part whatever its a roleplay gamemode or not.
     
  4. s2s.k

    s2s.k Member

    Messages:
    16
    Likes Received:
    0
    Joined:
    May 7, 2017
    And the sense then to do a function both on the server side and on the client side?

    [​IMG]
     
  5. -Andreas

    -Andreas Well-Known Member

    Messages:
    172
    Likes Received:
    25
    Joined:
    Sep 29, 2016
    If you create the blip server sided everyone will be able to see that blip. But if you for some reason only wish to show the blip to one specific player, you can do so by creating it using javascript on the client side. Imagine the person is on a job and the blip is his goal, then there's no reason for everyone to see.
     
    s2s.k likes this.
  6. s2s.k

    s2s.k Member

    Messages:
    16
    Likes Received:
    0
    Joined:
    May 7, 2017
    But that is not the server-side to create something specifically for one player?

    Here is an example with the same SA-MP:

    CreatePlayerObject // For the player
    CreateObject // For all
     
  7. -Andreas

    -Andreas Well-Known Member

    Messages:
    172
    Likes Received:
    25
    Joined:
    Sep 29, 2016
    I'm not sure I quite understand your question there buddy. But have a look at this page.
    https://wiki.gtanet.work/index.php?title=Category:API_Client
    These are all client API functions and if you wont code any javascript you wont be able to access them. So consider downloading the server file and look through the examples. You will get the hang of it quickly I'm sure.
     
  8. s2s.k

    s2s.k Member

    Messages:
    16
    Likes Received:
    0
    Joined:
    May 7, 2017
    Just the translator did not convey the essence of the question)) 00

    I meant, why it is impossible to create for example the same pick-up for the player in the connection callback on the server side? For example, in multiplayer SAMP there is this:

    http://wiki.sa-mp.com/wiki/CreatePlayerObject

    This function creates an object for the player, although it is a server-side.

    But it creates for all:

    http://wiki.sa-mp.com/wiki/CreateObject

    Sense then the client side of the GTA Network?
     
  9. TheSup

    TheSup Active Member

    Messages:
    79
    Likes Received:
    10
    Joined:
    Apr 18, 2017
    You should really have a look at the wiki.

    Client side = only for ONE player
    Server side = for EVERY player on the server

    Example:
    I would like to create a marker on the map where a specific player has to go...
    First I think about whether everybody should see this marker (ex. entrance hospital) or just one player should be able to see this marker (ex. job mission). In this case I choose clientside because only the client should see the marker.
    So I open up my editor and write the following code:

    Code:
    API.createMarker(0, new Vector3(1237,1878,1234), new Vector3(1,1,1), new Vector3(0,0,0),new Vector3(1,1,1), 20,0,60,255);
    The marker will be created by doing a special action.
     
  10. s2s.k

    s2s.k Member

    Messages:
    16
    Likes Received:
    0
    Joined:
    May 7, 2017
    Okay.

    And how do I determine which file to upload to the client? Is there a function? Or it is necessary to load all files?
     
  11. TheSup

    TheSup Active Member

    Messages:
    79
    Likes Received:
    10
    Joined:
    Apr 18, 2017
    While the client is connection to the server, the client downloads the server data (js-,html,css-files). When you want to call a client function u need to trigger a client event.

    Code:
    API.triggerClientEvent(Client player, string eventName, params object[] args);
    The client receives this event:


    Code:
    API.onServerEventTrigger.connect(function (eventName, args) {
      switch (eventName) {
    
        case 'atmEnterRange':
          API.sendNotification('There is an ATM nearby!');
          break;
        case 'atmLeaveRange':
          API.sendNotification("You've lost track of the nearby ATM.");
          break;
      }
    });

    And is doing the action that you have predefined.

    More reference in the wiki......

    https://wiki.gtanet.work/index.php?title=onServerEventTrigger
    https://wiki.gtanet.work/index.php?title=triggerClientEvent
    https://wiki.gtanet.work/index.php?title=triggerServerEvent
    https://wiki.gtanet.work/index.php?title=onClientEventTrigger
    https://wiki.gtanet.work/index.php?title=Category:API_Client
    https://wiki.gtanet.work/index.php?title=How_to_get_started_with_the_Client
     
    s2s.k likes this.
  12. s2s.k

    s2s.k Member

    Messages:
    16
    Likes Received:
    0
    Joined:
    May 7, 2017
    Thank you, understood.

    And what about HTML and CSS for details? Or where it can be found on WIKI?
     
  13. TheSup

    TheSup Active Member

    Messages:
    79
    Likes Received:
    10
    Joined:
    Apr 18, 2017
    Just search the main page for CEF. If u still have a question then -> just ask.
     
    s2s.k likes this.

Share This Page