Question about a stock and a command, +Rep!
#5

IMO stock is like a short form, i mean u can supress a code into a line or make a safe function and preventing hack.
for Example
pawn Код:
stock SendClientMessageToAllEx(exception, color, const message[])
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(i != exception)
      {
        SendClientMessage(i, color, message);
      }
    }
  }
}
u can use the above code to send a message to players other than the one u mentioned. Instead of typing
pawn Код:
for(new i; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(i !=playerid)
      {
        SendClientMessage(i, -1, "~");
      }
    }
  }
u can type

SendClientMessageToAllEx(playerid, -1, "~");
Reply


Messages In This Thread
Question about a stock and a command, +Rep! - by K9IsGodly - 14.01.2014, 00:10
Respuesta: Question about a stock and a command, +Rep! - by Swedky - 14.01.2014, 00:36
Re: Question about a stock and a command, +Rep! - by Emmet_ - 14.01.2014, 00:44
Re: Question about a stock and a command, +Rep! - by K9IsGodly - 14.01.2014, 00:50
Re: Question about a stock and a command, +Rep! - by newbie scripter - 14.01.2014, 02:08

Forum Jump:


Users browsing this thread: 1 Guest(s)