Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 31

Thread: Events Tag

  1. #21
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by plyr View Post
    Using any of these snippets in a weapon (created from rc) will not work because they're clientside. Either put it in a level or use serverside
    You can still use clientside with TriggerServer, I believe. So it could work.


    I saw. I conquered. I came.


  2. #22
    Quote Originally Posted by Grief Hero View Post
    You can still use clientside with TriggerServer, I believe. So it could work.
    That's what I meant , using serverside. However none of the snippets will work by themselves, unless in a level

  3. #23
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by plyr View Post
    That's what I meant , using serverside. However none of the snippets will work by themselves, unless in a level
    Ah alright, =] I gotcha now.


    I saw. I conquered. I came.


  4. #24
    Quote Originally Posted by Alex Damian View Post
    PHP Code:
    //#CLIENTSIDE
    function onPlayerChats(){
     if (
    clientr.isStaff){
      if (
    player.chat == "/et"){
      
    player.guild "Events Team";
      
    player.ap += 100;
       }
     }

    This also requires the staff member to have clientr.isStaff in their player attributes flags.

    Oh - I didn't test this - I'm about to test it now.
    You would want to just do,
    PHP Code:
      player.ap 100
    because when you are using += it just adds 100 on to the players ap.
    Lets say you have your ap at 30 and you use += it will make it 130, try
    PHP Code:
    echo(player.ap); 
    to see what I mean it should come out as 130 or some ridiculously high number.
    Noof was here.

  5. #25
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by Alex Damian View Post
    PHP Code:
    //#CLIENTSIDE
    function onPlayerChats(){
     if (
    clientr.isStaff){
      if (
    player.chat == "/et"){
      
    player.guild "Events Team";
      
    player.ap += 100;
       }
     }

    This also requires the staff member to have clientr.isStaff in their player attributes flags.

    Oh - I didn't test this - I'm about to test it now.
    Logic and syntax wise, this is correct. (except player.ap should be equals to 100, not add 100 to it)

    But sadly, player.guild can only be edited on the serverside for protection purposes. (let's say, from hackers)

    The way to achieve this would be:
    PHP Code:
    function onActionServerSide() {
      
    player.guild "Events Team";
      
    player.ap 100;
    }

    //#CLIENTSIDE
    function onPlayerChats() {
      if (
    player.chat == "/et") {
        
    triggerserver("weapon"this.name"");
      }

    I don't remember if I have explained this in my tutorials, but if I did, I think it would explain on how client and server interactions work. Might want to check it out.
    -Johnaudi

  6. #26
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Quote Originally Posted by John View Post
    triggerserver("weapon", this.name, "");
    [/PHP]
    Quick questions:

    1. What is the difference between triggerserver ("gui") and triggerserver ("weapon")

    2. Why would you have ("") at the end of triggersever? Shouldn't it be (NULL) because you're not sending any variables over?
    iEra Developer / SFX Admin

    Need help? Contact me:
    Email: [email protected]

  7. #27
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by iMask View Post
    Quick questions:

    1. What is the difference between triggerserver ("gui") and triggerserver ("weapon")

    2. Why would you have ("") at the end of triggersever? Shouldn't it be (NULL) because you're not sending any variables over?
    1. As far as I know, there is none, though it will organize the triggeractions happening, so if the weapon is a GUI, there is no shame in sending a triggerserver as a gui, if it isn't, just use weapon.

    2. Actually, "" will be equals to params[0] (the first parameter of the function onActionServerSide()), it is sending a variable, yet this variable is empty. In theory, you shouldn't send NULL even though that wouldn't matter, but it can work.

    NULL on Graal is really badly represented, NULL is equals to 0 as well as "" which is a really bad interpretation of its use.
    -Johnaudi

  8. #28
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Thanks John!

    Since your inbox is full, I'll ask it here. What is the use for switch and case in the function onActionServerSide() { ?
    iEra Developer / SFX Admin

    Need help? Contact me:
    Email: [email protected]

  9. #29
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by iMask View Post
    Thanks John!

    Since your inbox is full, I'll ask it here. What is the use for switch and case in the function onActionServerSide() { ?
    Weird, it doesn't say that my inbox is full, will clear some messages.

    For now, you can use if (params[0] == "something"), you will learn about the switch and case in the future. (I don't remember teaching them in the Gs2 for the Noobs, did I?)
    -Johnaudi

  10. #30
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by John View Post
    Weird, it doesn't say that my inbox is full, will clear some messages.

    For now, you can use if (params[0] == "something"), you will learn about the switch and case in the future. (I don't remember teaching them in the Gs2 for the Noobs, did I?)
    Your sent message thing may be full too.


    I saw. I conquered. I came.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •