07.11.2011, 11:23
But you code isn't correct.
It doesn't need to have two
Also, check again if the 4th NPC's file (.rec) is on the recordings folder and the .pwn in the npcmodes
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
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's name.
if(!strcmp(npcname, "Soldier_1", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerSkin(playerid, 287);
}
if(!strcmp(npcname, "Soldier_2", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerSkin(playerid, 287);
}
if(!strcmp(npcname, "Soldier_3", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerSkin(playerid, 287);
}
if(!strcmp(npcname, "Soldier_4", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerSkin(playerid, 287);
}
return 1;
}
return 1;
}
Код:
if(IsPlayerNPC(playerid))
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) { //Checks if the player that just spawned is an NPC.
new npcname[MAX_PLAYER_NAME];
//Getting the NPC's name.
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Soldier_1", true)) { //Checking if the NPC's name is MyFirstNPC
SetPlayerSkin(playerid, 287);
return 1;
}
if(!strcmp(npcname, "Soldier_2", true)) { //Checking if the NPC's name is MyFirstNPC
SetPlayerSkin(playerid, 287);
return 1;
}
if(!strcmp(npcname, "Soldier_3", true)) { //Checking if the NPC's name is MyFirstNPC
SetPlayerSkin(playerid, 287);
return 1;
}
if(!strcmp(npcname, "Soldier_4", true)) { //Checking if the NPC's name is MyFirstNPC
SetPlayerSkin(playerid, 287);
return 1;
}
return 1;
}
//For normal players goes here!
return 1;
}