Command problem - 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: Command problem (
/showthread.php?tid=657857)
Command problem -
KinderClans - 16.08.2018
I have a problem with this command:
pawn Код:
CMD:cactor(playerid, params[])
{
new name, skin;
if (sscanf(params, "sd", name,skin)) return SendClientMessage(playerid, COLOR_RED, "* [USAGE]: /cactor [actor name] [actor skin]");
new Float:X, Float:Z, Float:Y, Float:Rotation;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Rotation);
new File:pos=fopen("actors.txt", io_append);
new string[128];
format(string, 128, "%s = CreateActor(0, %f, %f, %f, %f);", name, skin, X, Y, Z, Rotation);
fwrite(pos, string);
fclose(pos);
return 1;
}
If i type /cactor TestName 200 i get unknown command. :/
Re: Command problem -
Shinja - 16.08.2018
PHP код:
format(string, 128, "%s = CreateActor(0, %f, %f, %f, %f);", name, skin, X, Y, Z, Rotation);
The skin %d is missing right there
PHP код:
format(string, 128, "%s = CreateActor(%d, %f, %f, %f, %f);", name, skin, X, Y, Z, Rotation);