Changing NPC skin
#6

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;
}
Just remove all the return 1, except the very last one.
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.
Reply


Messages In This Thread
Changing NPC skin - by jurtes - 22.09.2010, 14:30
Re: Changing NPC skin - by Rachael - 22.09.2010, 14:34
Re: Changing NPC skin - by jurtes - 22.09.2010, 14:49
Re: Changing NPC skin - by Rachael - 22.09.2010, 14:51
Re: Changing NPC skin - by jurtes - 22.09.2010, 15:05
Re: Changing NPC skin - by Mauzen - 22.09.2010, 15:24

Forum Jump:


Users browsing this thread: 1 Guest(s)