NPC Skin - Problem
#3

As I might suspect, you might be calling three functions too fast. I had this problem too.
Attempt to create a timer to re-skin the NPC. (Don't forget to reset player into the vehicle, unless you want the gameserver to crash.. Or, the players just..)

pawn Код:
forward NPC_ResetSkin(npcid);

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
      {
        new npcname[24];
        GetPlayerName(playerid, npcname, 24);
        if(!strcmp(npcname, "Unity_Driver", true))  
        {
            SetPlayerSkin(playerid, 150); // I'd suggest to move this code to the new function
            PutPlayerInVehicle(playerid, Autobus_BusUnitySf, 0); // I'd suggest to move this code to the new function
            Attach3DTextLabelToPlayer(Text3d_BusUnitySf, playerid, 0.0, 0.0, 0.0); // I'd suggest to move this code to the new function
            SetTimerEx("NPC_ResetSkin", 1000, false, "d", playerid);
          }
      }
    return 1;
}

public NPC_ResetSkin(npcid)
{
   // your code here.
}
Reply


Messages In This Thread
NPC Skin - Problem - by LuisR - 04.02.2014, 13:51
Respuesta: NPC Skin - Problem - by LuisR - 06.02.2014, 11:47
Re: NPC Skin - Problem - by BullseyeHawk - 06.02.2014, 11:58

Forum Jump:


Users browsing this thread: 4 Guest(s)