SA-MP Forums Archive
Format strings... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Format strings... (/showthread.php?tid=97496)



Format strings... - erorcun - 14.09.2009

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.


Re: Format strings... - Sergei - 14.09.2009

Why not just use ApplyAnimation on botid?


Re: Format strings... - erorcun - 14.09.2009

I want to use it for npc files.




Re: Format strings... - erorcun - 16.09.2009

Waiting for help.


Re: Format strings... - Mikep. - 16.09.2009

Why is the string name anus? [/joke]

I don't think bots can perform animations.


Re: Format strings... - dugi - 16.09.2009

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.


Re: Format strings... - erorcun - 16.09.2009

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;
}




Re: Format strings... - BigJayMalcolm - 16.09.2009

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.


Re: Format strings... - saiberfun - 16.09.2009

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


Re: Format strings... - erorcun - 16.09.2009

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.