ifIsplayername
#8

Quote:
Originally Posted by mavtias
Quote:
Originally Posted by patchkinson
yea
that was siliness of me
ty
No, It was not silly.
You are smart, because If you do not return 1; the code will repeat itself, in most cases.
So add return 1;
"return" stops the routine it is linked to (in the scope of), nothing will loop unless you tell it to do so (while,for,do).

In callbacks (events) some returns have an important value as it tells the Pawn VM what to do like allow other scripts to process the same callback or like in texts it controls if or not you see the message:

pawn Код:
@ OnPlayerCommandText(......)
{
  return 1; //no message, the command is processed
  return 0; //SUC message, the command wasn't valid or was unable to be processed
}

@ OnPlayerText(......)
{
  return 1; //message, the chat is processed
  return 0; //no message, this script won't process the chat
}
Take a look in the pdf for an explination of "return" or look at some of the many script examples we have around the forum (any GM, FS, INC).
Reply


Messages In This Thread
ifIsplayername - by patchkinson - 29.11.2009, 17:33
Re: ifIsplayername - by lolumadd - 29.11.2009, 17:36
Re: ifIsplayername - by patchkinson - 29.11.2009, 18:36
Re: ifIsplayername - by patchkinson - 29.11.2009, 18:38
Re: ifIsplayername - by lolumadd - 29.11.2009, 21:53
Re: ifIsplayername - by patchkinson - 29.11.2009, 22:01
Re: ifIsplayername - by Mike Garber - 04.12.2009, 14:34
Re: ifIsplayername - by Donny_k - 04.12.2009, 17:20
Re: ifIsplayername - by HydraX - 04.12.2009, 22:55
Re: ifIsplayername - by Gappy - 04.12.2009, 23:24

Forum Jump:


Users browsing this thread: 1 Guest(s)