• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [HELP] NPC anim
#1
Hi everyone, I have a little problem with NPCs.
I have created a fs animations for NPCs?to run via a command: /animname <npcname>
The problem is this: if there are two NPCs called NPC1 and NPC11 in game, when I assign an animation to NPC11 by typing for example /roadcross npc11, the animation is performed on NPC1.
It is as if the command captured NPC1 first.
Same thing happens, for example, if there are NPC2 and NPC21 ... The command is first captured by NPC2
Instead, if I delete NPC1 and now run the command on NPC11 it works.
Maybe there is a need to set the script so that you have to type the full name?
Do you know how I can solve?
This is the example of the script:

PHP Code:
CMD:npc_roadcross(playeridparams[])
{
new 
targetid;
if(
sscanf(params"u"targetid)) return SendClientMessage(playerid, -1"Use: /npc_anim <playerid/npc>");
? ? if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1"Invalid Player id.");
? ? 
ApplyAnimation(targetid"PED","roadcross",4.0,0,0,0,0,-1);
? ? return 
1;

  Reply


Messages In This Thread
[HELP] NPC anim - by spyrothedragon96 - 2021-02-19, 02:29 PM

Forum Jump: