Problems with npc
#1

Hello, i got a problem with my npcs. The first npc loads good, but the second npc, wont load the items that i scripted.

This is how it looks:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "intro", true))
        {
            PutPlayerInVehicle(playerid, introplane, 0);
            SetPlayerArmour(playerid, 0);
            SetPlayerColor(playerid, COLOR_WHITE);
        }
        if(strcmp(npcname, "cow1", true))
        {
            SetPlayerSkin(playerid,292);
            SetPlayerArmour(playerid, 0);
            SetPlayerColor(playerid, COLOR_WHITE);
            SetPlayerAttachedObject(playerid,2,16442,1,-0.41,0.12,-0.03,0.0,87.0,94.0,0.45,0.65,1.17);
        }
        return 1;
    }
But the npc dosent get the skin that i want, Or the object that i added to it. Anyone know how to fix this?

Regards, Alex
Reply
#2

You should skim through your scripts more carefully. The code below:

pawn Код:
if(strcmp(npcname, "cow1", true))
{
    SetPlayerSkin(playerid,292);
    SetPlayerArmour(playerid, 0);
    SetPlayerColor(playerid, COLOR_WHITE);
    SetPlayerAttachedObject(playerid,2,16442,1,-0.41,0.12,-0.03,0.0,87.0,94.0,0.45,0.65,1.17);
}
should be:

pawn Код:
if(!strcmp(npcname, "cow1", true))
{
    SetPlayerSkin(playerid,292);
    SetPlayerArmour(playerid, 0);
    SetPlayerColor(playerid, COLOR_WHITE);
    SetPlayerAttachedObject(playerid,2,16442,1,-0.41,0.12,-0.03,0.0,87.0,94.0,0.45,0.65,1.17);
}
You have forgotten the exclamation mark in front of your function.
Reply
#3

lol didnt see that :P thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)