OnPlayerUpdate
#1

OnPlayerUpdate is called just for players or npcs too?
Reply
#2

Just for players but if you want to use NPCs you must use the function ·IsPlayerNPC·

Example:

pawn Код:
public OnPlayerUpdate(playerid)
{
   SendClientMessage(playerid,-1,"Hello , this message will show each 1 second,");
   // This will show only to the player
   return true;
}
But if you want to do something with NPCs just use a restriction

pawn Код:
public OnPlayerUpdate(playerid)
{
   if(IsPlayerNPC(playerid))
   {
      // do something to NPCs
   }
   else
   {
      // do something to players
   }
   return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)