SA-MP Forums Archive
"SERVER: Unknown Command" - 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: "SERVER: Unknown Command" (/showthread.php?tid=604443)



"SERVER: Unknown Command" - nerovani - 05.04.2016

So I made a object system thing and everything in it works, moving the objects, etc.

The system is saved and loaded using y_ini and it is working perfectly.

I wanted to save myself time from copying every value from each file manually and putting it in "CreateDynamicObject" when I export it for later use and made a command that does it for me.

Код:
CMD:conv(playerid)
{
new str[256], File:ftw=fopen("objects.txt", io_write);
for(new did=1; did<MAX_DOBJECTS; did++) // Dynamic Houses
{
	if(ObjectInfo[did][ObjectID] != 0){
		format(str, sizeof(str), "CreateDynamicObject(%d,%f,%f,%f,%f,%f,%f,-1,-1,-1,300.0,0.0);\n\r",ObjectInfo[did][ObjectID], ObjectInfo[did][ObjectX], ObjectInfo[did][ObjectY],ObjectInfo[did][ObjectZ],ObjectInfo[did][ObjectRX],ObjectInfo[did][ObjectRY],ObjectInfo[did][ObjectRZ]); // format
		fwrite(ftw, str);}
}
fclose(ftw);
return 1;
}
The only problem now is that when I type the command in-game, it returns me "SERVER: Unknown Command" and the "objects.txt" file is blank.

Any suggestions/help?


Re: "SERVER: Unknown Command" - Harty - 05.04.2016

It's related on save functions.


Re: "SERVER: Unknown Command" - nerovani - 05.04.2016

And how can I make it work?