1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

args[0]

Discussion in 'Facepalm' started by Jonas, Apr 4, 2017.

Thread Status:
Not open for further replies.
  1. Jonas

    Jonas Baby Zombie

    Messages:
    192
    • This thread is an entire comedy that shall serve much research value for aliens trying to understand the puzzling intelligence of humanity. For humans who want to read this, assume that this thread was posted on April Fool's day.
    How can i define the player with $args[0] in a command?
     
  2. NIIP99

    NIIP99 Silverfish

    Messages:
    22
    GitHub:
    niip99
    PHP:
    Server->getPlayerExact($args[0]);
    You mean get player from array(0)?
     
  3. [deleted]

    [deleted] Guest

    Hi,

    Just use :
    Code:
    $this->getServer ()->getPlayer ("$args [0]");
     
  4. Jonas

    Jonas Baby Zombie

    Messages:
    192
    No i will in a command define the player with $args[0] (/trollkick Name)
     
  5. [deleted]

    [deleted] Guest

    Then use my way. After this Code i typed before use kick () to kick a Player.
     
  6. Jonas

    Jonas Baby Zombie

    Messages:
    192
    How define the player in a command with $args[0]
     
  7. [deleted]

    [deleted] Guest

    Use this in your Command:
    PHP:
    $tokick $this->getServer()->getPlayer("$args[0]");
    $tokick->kick("KICKED");
     
  8. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Thats wrong. (“args[0]“); isnt a string
    This is right
    PHP:
    $args $this->getServer()->getPlayer($args[0]);
     
    XdmingXD likes this.
  9. [deleted]

    [deleted] Guest

    Thats wrong

    I tried it years ago and it worked fine.
    Some of my first old Plugins like VIPItems or these other **** i made use this and it still work
     
    Last edited by a moderator: Apr 4, 2017
  10. NIIP99

    NIIP99 Silverfish

    Messages:
    22
    GitHub:
    niip99
    @morpheus132
    You're "very false"
    $args[0] is a variable, you u need to change it to string? Please learn PHP.
    PHP treats $ in a string as variable too, that's why your code is working. And @Jonas is correct, please dont mislead him.
     
  11. [deleted]

    [deleted] Guest

    • And this, this, is how all the arrogance and ignorance of humanity ruins the world.
    I have learned PHP since half a year ;)
    I know variables, events, particles, data saving, mt_rand and so on. Maybe I use it in a String because it always worked and I do not see the Reason why I should change it. But dont worry, I just tried to help. And its working.
     
  12. NIIP99

    NIIP99 Silverfish

    Messages:
    22
    GitHub:
    niip99
    Im glad you have half and a year of PHP experience and list out all your PHP knowledge like mt_rand, data saving to me. I appreciate your list :)
    But I can tell if you familiar with PHP just by your code:
    PHP:
    "$args[0]";
    And yep, you are not that good in PHP. :shoghi:

    I know you want to help, just please dont mislead others ;) And dont saying people wrong who were actually right.
     
  13. [deleted]

    [deleted] Guest

    Not half AND a year just a half year. My first thing I did was Commands. I started with using at Commands "$args [0]" and I never changed.

    And I dont think you are in the position to say whos good and whos not :facepalm:
     
  14. [deleted]

    [deleted] Guest

    Lets dont go off-topic and clear this thing in a Conversation if you have further Questions. Thanks!
     
  15. [deleted]

    [deleted] Guest

    I just wanted to say that im not a "early" beginner. Bruh
     
  16. NIIP99

    NIIP99 Silverfish

    Messages:
    22
    GitHub:
    niip99
    You said "half a year" quote morpheus132.

    And yep, then why you say @Jonas is false while he is absolutely correct? You're not in the position to say him wrong either.

    I'm not judging you or what. I'm just talking the truth. If @Jonas is wrong with his code in this case, i will tell him. But now you are partially wrong with your code, so I'm just here to tell you. No offense

    Agreed, my sorry if I said you are not that good in PHP.
    And yes, if you wanna continue this, just PM me. ;) Dont go off topic.
     
  17. [deleted]

    [deleted] Guest

    My bad english, thought half a year mean a half year?!!
     
  18. [deleted]

    [deleted] Guest

    And @Jonas told me in a Conversation that he fixed his problem.
     
  19. [deleted]

    [deleted] Guest

    And I know I was a bit wrong FOR YOU. But for me its wrong of it doesnt work or if it dont work correctly. So fine!
     
  20. [deleted]

    [deleted] Guest

    And I know im N O T the best in PHP lol I just meant im not a early beginner
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.