Skip to content

Standard NPC Alternatives

WoutProvost edited this page Jul 16, 2019 · 4 revisions

HomeStandard NPC Alternatives

Callbacks










  • SA-MP wiki: http://wiki.sa-mp.com/wiki/NPC:OnPlayerStreamIn (don't confuse with http://wiki.sa-mp.com/wiki/OnPlayerStreamIn)
  • Description: Gets called when a player is streamed in by an NPC.
  • FCNPC equivalent: None. NPCs don't stream anything, only a player's client does that, so using the player version of OnPlayerStreamIn will not work as an alternative. FCNPC_OnStreamIn gets called when an NPC is streamed in by a player, which is the equivalent of the player version of OnPlayerStreamIn and not the NPC version of OnPlayerStreamIn.

  • SA-MP wiki: http://wiki.sa-mp.com/wiki/NPC:OnPlayerStreamOut (don't confuse with http://wiki.sa-mp.com/wiki/OnPlayerStreamOut)
  • Description: Gets called when a player is streamed out by an NPC.
  • FCNPC equivalent: None. NPCs don't stream anything, only a player's client does that, so using the player version of OnPlayerStreamOut will not work as an alternative. FCNPC_OnStreamOut gets called when an NPC is streamed out by a player, which is the equivalent of the player version of OnPlayerStreamOut and not the NPC version of OnPlayerStreamOut.



  • SA-MP wiki: http://wiki.sa-mp.com/wiki/NPC:OnClientMessage
  • Description: Gets called when an NPC sees a client message (broadcast or personally to him).
  • FCNPC equivalent: None, but can be simulated by hooking SendClientMessageToAll and SendClientMessage. This callback gets called whenever an NPC sees a client message. This will be everytime a SendClientMessageToAll function is used and everytime a SendClientMessage function is used towards an NPC. This callback won't be called when someone says something in the chat.

  • SA-MP wiki: http://wiki.sa-mp.com/wiki/NPC:OnPlayerText (don't confuse with http://wiki.sa-mp.com/wiki/OnPlayerText)
  • Description: Gets called when anyone says anything in the chat.
  • FCNPC equivalent: None, but can be simulated by hooking the player version of OnPlayerText and SendPlayerMessageToAll. Opposed to the player version of this callback, this callback gets called everytime anyone says anything in the chat. This includes any player and any other NPC or the same NPC himself with SendChat.

Natives


  • SA-MP wiki: http://wiki.sa-mp.com/wiki/IsPlayerNPC (no NPC: prefix)
  • Description: Checks whether a player is an actual player or an NPC.
  • FCNPC equivalent: FCNPC_IsValid. IsPlayerNPC will still work with NPCs created with FCNPC, but if you specifically want to check if the NPC is created with FCNPC and is not a standard NPC, you will need FCNPC_IsValid.










  • SA-MP wiki: http://wiki.sa-mp.com/wiki/NPC:IsPlayerStreamedIn (don't confuse with http://wiki.sa-mp.com/wiki/IsPlayerStreamedIn)
  • Description: Checks whether a player is streamed in for an NPC.
  • FCNPC equivalent: None. NPCs don't stream anything, only a player's client does that, so using the player version of IsPlayerStreamedIn with the first parameter the player and the second an NPC will not work as an alternative. FCNPC_IsStreamedIn can be used to check if an NPC is streamed in for a player, which is the equivalent of the player version of IsPlayerStreamedIn with the first parameter an NPC and the second the player and not the NPC version of IsPlayerStreamedIn.