SA-MP Forums Archive
SetPlayerSkin doesn't work to NPCs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: SetPlayerSkin doesn't work to NPCs (/showthread.php?tid=302383)



SetPlayerSkin doesn't work to NPCs - Awesome™ - 08.12.2011

The title says everything.

All skins have class id 0. (In my case grove skin)
SetPlayerSkin won't work. (To real players, it works)


Re: SetPlayerSkin doesn't work to NPCs - B2S_MrLoL - 08.12.2011

Yes, same bug -.-


Re: SetPlayerSkin doesn't work to NPCs - Thresholdold - 08.12.2011

My NPCs wont connect to my server, can you show me the code where you connected your NPCs?


AW: SetPlayerSkin doesn't work to NPCs - Awesome™ - 08.12.2011

Did they connect on 0.3c server?

In "OnGameModeInit" I placed this:
Код:
ConnectNPC("FIBAgent", "FIBAgent");
in "OnPlayerSpawn" this:
Код:
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!strcmp(sendername, "FIBAgent"))
{
	SetPlayerSkin(playerid, 165);
}
.. and this in "FIBAgent.pwn" (in "npcmodes" folder)
Код:
#include "a_npc"
#define RECORDING "FIBAgent"

main() {}

public OnRecordingPlaybackEnd() StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT, RECORDING);
public OnNPCSpawn() StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT, RECORDING);



Re: SetPlayerSkin doesn't work to NPCs - leong124 - 09.12.2011

Are you sure your code get run?
Try this:
pawn Код:
new sendername[MAX_PLAYER_NAME];
print("test1");
GetPlayerName(playerid, sendername, sizeof(sendername));
print("test2");
if(!strcmp(sendername, "FIBAgent"))
{
    print("test3");
    SetPlayerSkin(playerid, 165);
    print("test4");
}
or simply try the crashdetect plugin to see if there is any run-time error: https://sampforum.blast.hk/showthread.php?tid=262796

Since it works fine for me on 0.3c and 0.3d, I guess it should be the problem of your script.


AW: SetPlayerSkin doesn't work to NPCs - Awesome™ - 09.12.2011

I already tried it. it prints all prints. :/