Author Topic: Checking if a string is alphabetical  (Read 1259 times)

How would I go about checking if a person is actually on the server, my code is like so.

Code: [Select]
%target = findclientbyname(%target);
if(%target $= "")
    return;
That works all fine and dandy but they can type in any name and it will go through.
I need a way to check if they're on the server.


Recycled topic, check title.
« Last Edit: April 21, 2014, 10:58:13 PM by Starzy »

%target = findClientByName(%target);
if(!isObject(%target))
{
   messageClient(%client,'',"\c6That person doesn't exist!");
   return;
}
« Last Edit: April 21, 2014, 09:40:48 PM by Advanced Bot »

%target = findClientByName(%target);
if(!isObject(%target))
   return messageClient(%client,'',"\c6That person doesn't exist!");

Sweet thanks.

return messageClient(%client,'',"\c6That person doesn't exist!");
Are you being serious right there

Are you being serious right there
It works though lol..
Yes, it does return whatever returns in the function of that

Recycled topic, how would I go about doing this?


What do you mean? Give us an example.

Recycled topic, how would I go about doing this?

if(!strLen(stripChars(%string, "abcdefghijklmnopqrstuvwxyz")))

if(!strLen(stripChars(%string, "abcdefghijklmnopqrstuvwxyz")))
Yay, thanks a lot.

It works though lol..
Yes, it does return whatever returns in the function of that
It works because of how dork torkscript is, but it is very bad practice. You shouldn't use return like that with a function that doesn't return anything in a function that doesn't return anything.

I'm pretty sure it'll actually give a console error, so don't do that.

I'm pretty sure it'll actually give a console error, so don't do that.

I'm pretty sure it wont,  it will just return an empty string (or perhaps NULL, but that's sorta the same thing in torquescript).

I'm pretty sure it'll actually give a console error, so don't do that.

It will display a console error if the function is a one exposed by the engine. Try echo(setClipboard(""));

It will display a console error if the function is a one exposed by the engine. Try echo(setClipboard(""));
Yeah, I got that confused for one of the engine functions. My bad, it'll work.

I still don't recommend it, but it'll work.