22.09.2010, 15:24
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npc_name[24];
GetPlayerName(playerid,npc_name,sizeof(npc_name));
if(!strcmp(npc_name,"Cocaine1",false))
{
SetPlayerSkin(playerid, 144); // your skin choice for NPC
}
if(!strcmp(npc_name,"Cocaine2",false))
{
SetPlayerSkin(playerid, 144); // your skin choice for NPC
}
if(!strcmp(npc_name,"Cocaine3",false))
{
SetPlayerSkin(playerid, 144); // your skin choice for NPC
}
}
return 1;
}
And for the performance and a clean style dont do the
IsPlayerNPC, GetPlayerName stuff again and again. Checking it one time is enough, if you got the name, just check them one directly after the other.