halpp

halpp

Postby Warren1001 » 05 Jul 2013, 22:34

I made my own custom disinfect command that allows me to disinfect myself and others.
At the beginning if I put:
Code: Select all
if (message == null)
{
   //disinfects me
}

It won't work, it only allows me to disinfect others. It gives me the message of "player could not be found" if I type /disinfect without anything.
if at teh beginning I put:
Code: Select all
if (message.IndexOf(' ') == -1)
{
   //disinfects me
}

It only allows me to disinfect myself. It gives me the message of "you're still human", as if I'm trying to disinfect myself.
full command:
Spoiler:
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50

Re: halpp

Postby ismellike » 05 Jul 2013, 23:00

The code says if who==null or who is hidden, it will stop with a message. Replace the message and return with who=p;
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: halpp

Postby Warren1001 » 06 Jul 2013, 00:32

ismellike wrote:The code says if who==null or who is hidden, it will stop with a message. Replace the message and return with who=p;

*facepalm* ty
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 9 guests

cron