Format strings...
#1

pawn Код:
public ApplyAnimation(playerid, animlib[], animname[], Float:fS, opt1, opt2, opt3, opt4, opt5)
{
new anas[256];
format(anas,sizeof(anas),"/aap %d %s %s %f %d %d %d %d %d", playerid, animlib, animname, fS, opt1, opt2, opt3, opt4, opt5);
SendCommand(anas);
return 1;
}
I did it for NPCs.
But the command comes as follows:

playerid animlib anim name fS opt1 opt2 opt3 opt4 opt5
6 , BSKTBALL , null 4.1 1 1 1 1 1 , 0.00000 , 0 , 0 , 0 , 0 , 0

Sorry for my english.

Thanks.
Reply
#2

Why not just use ApplyAnimation on botid?
Reply
#3

I want to use it for npc files.

Reply
#4

Waiting for help.
Reply
#5

Why is the string name anus? [/joke]

I don't think bots can perform animations.
Reply
#6

Bots can perform animations, but the problem of the OP is that the doesn't understand the basics of scripting and that this code won't even work.
Reply
#7

This code should work, but does not work.

/aap command was defined in gamemode.

In addition, these works:

pawn Код:
public SetPlayerPos(playerid, Float:x, Float:y, Float:z)
{
new anas[256];
format(anas,sizeof(anas),"/setplayerpos %d %f %f %f", playerid, x, y, z);
SendCommand(anas);
return 1;
}

public SetPlayerHealth(playerid, Float:health)
{
new anas[256];
format(anas,sizeof(anas),"/setplayerhealth %d %f", playerid, health);
SendCommand(anas);
return 1;
}

public SetPlayerArmour(playerid, Float:armour)
{
new anas[256];
format(anas,sizeof(anas),"/setplayerarmour %d %f", playerid, armour);
SendCommand(anas);
return 1;
}

public SetPlayerName(playerid, name[])
{
new anas[256];
format(anas,sizeof(anas),"/setplayername %d %s", playerid, name);
SendCommand(anas);
return 1;
}

public SetPlayerSpecialAction(playerid, actionid)
{
new anas[256];
format(anas,sizeof(anas),"/spsa %d %i", playerid, actionid);
SendCommand(anas);
return 1;
}

public SetMySpecialAction(actionid)
{
new anas[256];
format(anas,sizeof(anas),"/smsa %i", actionid);
SendCommand(anas);
return 1;
}

Reply
#8

That is honestly the wierdest type of scripting i have ever seen :/ I got my NPCs to work with anims using normal coding for normal people.
Reply
#9

Quote:
Originally Posted by BigJayMalcolm
That is honestly the wierdest type of scripting i have ever seen :/ I got my NPCs to work with anims using normal coding for normal people.
haha seen worse stuff than this.

erorcun try to learn the basics first

https://sampwiki.blast.hk/wiki/Scripting_Basics
Reply
#10

Quote:
Originally Posted by SaiBerFun
Quote:
Originally Posted by BigJayMalcolm
That is honestly the wierdest type of scripting i have ever seen :/ I got my NPCs to work with anims using normal coding for normal people.
haha seen worse stuff than this.

erorcun try to learn the basics first

https://sampwiki.blast.hk/wiki/Scripting_Basics
xD xD xD

I just wanted help to "format string"

I will use this for any other purpose.

I know the scripting basics.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)