14.03.2010, 19:45
how to change bots / NPC skin?
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;
}
//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;
}