SA-MP Forums Archive
[npc]help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [npc]help (/showthread.php?tid=134002)



[npc]help - Zeros - 14.03.2010

how to change bots / NPC skin?


Re: [npc]help - GforceNL - 14.03.2010

Код:
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); 
    if(!strcmp(npcname, "NPC NAME", true))
    {
			SetPlayerSkin(playerid, 'skinid');
			return 1;
    }
    return 1;
  }
 return 1;
}



Re: [npc]help - Zeros - 15.03.2010

Код:
//Los Santos Mig_1
//------------------------------------------------------------------------------
#include <a_samp>
#include <a_npc>
//------------------------------------------------------------------------------
new Guard;
//------------------------------------------------------------------------------
public OnFilterScriptInit()
{
  print("LS Police Guard");
  ConnectNPC("[BOT]Mig_1","Mig_1");
  Guard = CreateVehicle(520, 0.0, 0.0, 5.0, 0.0, 0, 1, 5000);
  return 1;
}
//------------------------------------------------------------------------------
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC name.
    if(!strcmp(npcname, "[BOT]Mig_1", true)) //Checking if the NPC's name is [BOT]Mig_1
    {
      PutPlayerInVehicle(playerid, Guard, 0); //Putting the NPC into the vehicle we created for it.
      SetPlayerSkin(playerid, '70');
    }
    return 1;
  }
  return 1;
}
like this?


Re: [npc]help - Zeros - 16.03.2010

pliz help


Re: [npc]help - boelie - 16.03.2010

change SetPlayerSkin(playerid, '70');

to

SetPlayerSkin(playerid, 70);