Bot animation - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bot animation (
/showthread.php?tid=331613)
Bot animation -
Tomer!.$ - 05.04.2012
How can I set a bot to do animation? ApplyAnimation didn't work for me.
The script I did:
PHP код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
SetPlayerSkin(playerid, 28);
SetPlayerPos(playerid, 2084.8064,-1582.5946,13.4408); // Bot);
SetPlayerFacingAngle(playerid, 336.4998);
ApplyAnimation(playerid, "DEALER", "DEALER_IDLE", 4.1, 0, 1, 1, 1, 0, 1);
new Text3D:label = Create3DTextLabel("Wanna get some coke nigga?", COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.1);
}
else
{
SetPlayerPos(playerid, 2084.8809,-1565.4945,13.3551);
SetPlayerColor(playerid, 0xFFFFFF00);
GivePlayerMoney(playerid, 10000);
}
return 1;
}
Re: Bot animation -
Ezay - 05.04.2012
I Beleave you can Record the Animation if you Make a Command in your Script.
Then Record it With your ((/rcon loadfs npc_record)).
I'm Sure it Works
Cheers
Ezay
\o/
Re: Bot animation -
Tomer!.$ - 05.04.2012
I know that I can do that.. I am seeking for any way to do this with a function instead.
Re: Bot animation -
blank. - 05.04.2012
You have to record it manually as fair as I know and run it using
https://sampwiki.blast.hk/wiki/NPC:StartRecordingPlayback
https://sampwiki.blast.hk/wiki/NPC:StopRecordingPlayback
Re: Bot animation -
Catalyst- - 05.04.2012
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
if(IsPlayerNPC(playerid))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(!strcmp(name, "NPC_NAME", false)) // Change NPC_NAME to the name of your NPC
{
ApplyAnimation(playerid, "DEALER", "DEALER_IDLE", 4.1, 0, 1, 1, 1, 0, 1);
}
}
return 1;
}
EDIT: Sorry, I wasn't thinking, there's no need for a loop. This should be a lot better.
Re: Bot animation -
Tomer!.$ - 05.04.2012
Thanks, working.