How will the player attack the NPC to be attacked by the NPC?
#1

Code :

#include <a_samp>

public OnFilterScriptInit()
{
print("\n-----------------------------------");
print(" NPC policijski botovi | StjepanS");
print("------------------------------------\n");
return 1;
}

public OnGameModeInit()
{
ConnectNPC("StjepanSBot","npcstjepans");
ConnectNPC("StjepanSBot1","npcstjepans1");
return 1;
}

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) // Provjerava da li se spawnao NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); // Dobivanje imena NPCa
if(!strcmp(npcname, "StjepanSBot", true))
{
SetPlayerColor(playerid, 0xFFFFFFAA);// Stavlja bijelu boju NPCu.
SetPlayerSkin(playerid, 281);// Stavlja skin NPCu id 281
SetPlayerAttachedObject(playerid,0,19142,1,0.04930 0,0.035000,-0.003500,0.000000,0.000000,0.000000,1.100000,1.100 000,1.100000);// Postavlja NPCu objekt pancirke
}
if(!strcmp(npcname, "StjepanSBot1", true))
{
SetPlayerColor(playerid, 0xFFFFFFAA);// Stavlja bijelu boju NPCu.
SetPlayerSkin(playerid, 280);// Stavlja skin NPCu id 280
SetPlayerAttachedObject(playerid,0,19142,1,0.04930 0,0.035000,-0.003500,0.000000,0.000000,0.000000,1.100000,1.100 000,1.100000);// Postavlja NPCu objekt pancirke
}
}
return 1;
}
Reply
#2

If you wish to make an NPC attack you in return then you should use FCNPC plugin which allows you to do almost everything with NPC and making complex artificial intelligence for it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)