SA-MP Forums Archive
I have any error with my /save cmd - 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: I have any error with my /save cmd (/showthread.php?tid=233806)



I have any error with my /save cmd - RGB52 - 02.03.2011

I have started my Debug FS and have error with /Save cmd.
pawn Код:
#include <a_samp>
#include <file>
#define COLOR_SERVER 0xFF6666FF
new Float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], Float:Z[MAX_PLAYERS], Float:A[MAX_PLAYERS], Float:I[MAX_PLAYERS];
new S[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
    new File:hFile;
    new string[128];
    if(strcmp("/SavPos", cmdtext, true) == 0)
    {
        S[playerid] = (GetPlayerSkin(playerid));
        GetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
        GetPlayerFacingAngle(playerid, A[playerid]);
        I[playerid] = (GetPlayerInterior(playerid));
        hFile = fopen("AddPlayerClass.log", io_append);
        format(string, sizeof(string), "AddPlayerClass(%s, %s, %s, %s, %s, 0, 0, 0, 0, 0, 0); //Interior: %s", S, X, Y, Z, A, I);
        fwrite(hFile, string);
        fclose(hFile);
        SendClientMessage(playerid, COLOR_SERVER, "Your position was saved.");
        SendClientMessage(playerid, COLOR_SERVER, string);
        return 1;
    }
    return 0;
}
Result: AddPlayerClass(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //Interior: 0

PD: If i have gramatical error in my FS or in the post, say it to me at MP please, i don't speak very English. MP.