Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: PR Tag

  1. #11
    1. This can be used as a weapon on Remote Control
    2. It is not used in a level
    3. It is player.guild not set.guild
    4. I don't understand how you can script partially, but don't even know what Remote Control is...
    5. This one I made works like a charm.

    Code:
    // Scripted by JohnRaven (SFR)
     function onActionServerSide() {
    switch (params[0]){
    case "/pr":
    player.guild = params[1];
    break;
    }
    }
    
    //#CLIENTSIDE
    function onPlayerChats() {
    if (player.chat.starts("/pr")){
    player.guild == "Player Relations"
     }

  2. #12
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    If the case and switch is too complex for you, here's another one that works:
    PHP Code:
    findplayer ("id").addWeapon(this.name);
    function 
    onActionServerSide () {
      
    player.guild "Player Relations";
      
    player.ap 100;
    }
    //#CLIENTSIDE
      
    function onPlayerChats () {
        if (
    player.chat == "/pr") {
          
    triggerserver ("gui"this.name"");
        }
      } 
    EDIT:

    Quote Originally Posted by Johnyoungman224 View Post
    Code:
    // Scripted by JohnRaven (SFR)
    //#CLIENTSIDE
    function onPlayerChats() {
    if (player.chat.starts("/pr")){
    player.guild == "Player Relations"
     }
    This shouldn't work.

    1. player.guild is a serverside command, you can't set it in clientside

    2. Pay close attention to your equal signs.
    PHP Code:
    player.guild == "Player Relations"
    should be:
    PHP Code:
    player.guild "Player Relations"
    One equal sign means that you are making it equal to that. Two equal signs means you are checking to see if something is true.

    3.
    PHP Code:
    if (player.chat.starts("/pr")){ 
    should be
    PHP Code:
    if (player.chat.starts == "/pr") { 
    Last edited by iMask; 02-02-2015 at 02:42 PM.
    iEra Developer / SFX Admin

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

  3. #13
    Quote Originally Posted by iMask View Post
    If the case and switch is too complex for you, here's another one that works:
    PHP Code:
    findplayer ("id").addWeapon(this.name);
    function 
    onActionServerSide () {
      
    player.guild "Player Relations";
      
    player.ap 100;
    }
    //#CLIENTSIDE
      
    function onPlayerChats () {
        if (
    player.chat == "/pr") {
          
    triggerserver ("gui"this.name"");
        }
      } 
    EDIT:



    This shouldn't work.

    1. player.guild is a serverside command, you can't set it in clientside

    2. Pay close attention to your equal signs.
    PHP Code:
    player.guild == "Player Relations"
    should be:
    PHP Code:
    player.guild "Player Relations"
    One equal sign means that you are making it equal to that. Two equal signs means you are checking to see if something is true.

    3.
    PHP Code:
    if (player.chat.starts("/pr")){ 
    should be
    PHP Code:
    if (player.chat.starts == "/pr") { 
    Thank you, iMask. I had scripted this really quick as it was nearly 3:00am and I was tired. But now that I look I see many errors in it It still works though

  4. #14
    Looking through you're progress now, and I suggest that you stick to using strictly clientside, it is good that you are going ahead and exploring trigger server. But if you're making some mistakes with the regular syntax you might not be ready to take the next step. Im not being a dream crusher but this is my opinion.

    You should try making a loop, a for loop and than have the
    PHP Code:
    player.chat 
    equal to the variable you've created in the loop.

    For loop Reminder,
    PHP Code:
      for(this.100this.0this.i--) {
        
    //print to the players chat
      

    If you can do this with no errors than you are ready, Do not forget the //#CLIENTSIDE either and the for loop must go inside the onCreated().

    Good Luck,

    Feel free to ignore this as you please.
    Noof was here.

Posting Permissions

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