18.02.2012, 13:25
Alright so I have been having problems with NPC's for the last week now, this is my current code
I have tried if(forplayerid == 0) too, no luck.
NPC MiniScript.
All help is appreciated
pawn Код:
public OnGameModeInit()
{
loadnpcs();
}
forward loadnpcs();
public loadnpcs()
{
ConnectNPC("Hobo","Hobo");
return 1;
}
forward Hobo();
public Hobo()
{
ApplyAnimation(0, "CRACK", "crckidle2", 4.0, 0, 0, 0, 0, 1);
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
ApplyAnimation(playerid, "CRACK", "Null", 4.0, 0, 0, 0, 0, 1);
ApplyAnimation(playerid, "CRACK", "Null", 4.0, 0, 0, 0, 0, 1);
if(IsPlayerNPC(playerid))
{
new name[24];GetPlayerName(playerid,name,24);
if(strcmp(name,"Hobo",true) )
{
SetPlayerSkin(playerid,230);
SetTimer("Hobo",1000,0);
return 1;
}
if(strcmp(name,"Hobo2",true)!=0)
{
SetPlayerSkin(playerid, 230);
return 1;
}
}
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
if(playerid == 0)
{
ApplyAnimation(0, "CRACK", "crckidle2", 4,0,0,0,0,1);
return 1;
}
return 1;
}
pawn Код:
#include <a_npc>
//------------------------------------------
main()
{
}
public OnNPCSpawn()
{
//SetMyPos(-580.7319,2612.1948,53.9348);
StartRecordingPlayback(2,"Hobo");
PauseRecordingPlayback();
return 1;
}
//------------------------------------------
All help is appreciated