SetPlayerSkin doesn't work to NPCs
#1

The title says everything.

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

Yes, same bug -.-
Reply
#3

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

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);
Reply
#5

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.
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)