SA-MP Forums Archive
Automatic save!! - 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: Automatic save!! (/showthread.php?tid=93265)



Automatic save!! - MB@ - 24.08.2009

I dont know how to make a script that automaticly saves your : score, money, skin and color??
Please Help!!


Re: Automatic save!! - Energyzer - 24.08.2009

First, use the search button and read the rules, second, welcome.

Search in your GameMode something similar to this:
pawn Код:
accountstimer = SetTimer("SaveAccounts", 900000, 1); //15 mins every account saved
Change for the time do you need.

But if you want save when the player leaves the server, search in your gamemode OnPlayerDisconnect and put: SaveAccounts(); or your accounts variable.

If you want save with a command use this:
pawn Код:
if(strcmp(cmd, "/saveaccounts", true) == 0)
    {
        if (PlayerInfo[playerid][pAdmin] >= 2) // Change for your required level admin.
        {
            SaveAccounts(); // Change for your account variable.
            SendClientMessage(playerid, COLOR_YELLOW, "The Accounts saved correctly.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "  You are not autorized to use that command!");
        }
        return 1;
    }
Good Luck, and USE THE SEARCH BUTTON BEFORE POST.


Re: Automatic save!! - MB@ - 24.08.2009

Can u just tell me one...
I made this

Код:
public OnPlayerConnect(playerid)
{new string[128];
 format(string, sizeof(string), "STATS : Score : %d , Money : %d , Color : %d , Skin : %d , AdminLevel : %d", GetPlayerScore(playerid), GetPlayerMoney(playerid) , GetPlayerColor(playerid) , GetPlayerSkin(playerid) , IsPlayerAdmin(playerid));
I done this and it works fine. But how can i make that this shows after i log in


Re: Automatic save!! - Energyzer - 24.08.2009

pawn Код:
public OnPlayerConnect(playerid)
{
new string[128];
 format(string, sizeof(string), "STATS : Score : %d , Money : %d , Color : %d , Skin : %d , AdminLevel : %d", GetPlayerScore(playerid), GetPlayerMoney(playerid) , GetPlayerColor(playerid) , GetPlayerSkin(playerid) , IsPlayerAdmin(playerid));
SendClientMessage(playerid, COLOR_WHITE,string);
Easy.