SA-MP Forums Archive
save player info - 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: save player info (/showthread.php?tid=93261)



save player info - sggassasin - 24.08.2009

how do i save player info into a text file or something so that when they go /register they get a file and when i go /ban it puts a value to 1 and if i change that to 0 then there un baned so a little help here




thx for ur time


Re: save player info - MenaceX^ - 24.08.2009

Quote:

ps.im not useing a difrent register system

Huh? How would I even know what you use?


Re: save player info - Energyzer - 24.08.2009

For save player's accounts use this:

pawn Код:
if(strcmp(cmd, "/saveaccounts", true) == 0)
    {
        if (PlayerInfo[playerid][pAdmin] >= 2) // You can change for the required level admin.
        {
            SaveAccounts(); // You can change for your accounts variable
            SendClientMessage(playerid, COLOR_YELLOW, "The Accounts saved correctly.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "  You are not autorized to use that command!");
        }
        return 1;
    }



Re: save player info - sggassasin - 24.08.2009

Quote:
Originally Posted by Energyzer
For save player's accounts use this:

pawn Код:
if(strcmp(cmd, "/saveaccounts", true) == 0)
    {
        if (PlayerInfo[playerid][pAdmin] >= 2) // You can change for the required level admin.
        {
            SaveAccounts(); // You can change for your accounts variable
            SendClientMessage(playerid, COLOR_YELLOW, "The Accounts saved correctly.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, " You are not autorized to use that command!");
        }
        return 1;
    }
i whanted to do it auto so like when they leave the sever there info gets saved in a file in the script file so could someone help thx


Re: save player info - Energyzer - 24.08.2009

Then, 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, And when the player leaves the server, search in your gamemode OnPlayerDisconnect, and put: SaveAccounts();.

but if you want date and hour, i think you need use the command that I put before.

PD: I edit for add some info



Re: save player info - sggassasin - 24.08.2009

ok so dose that save an acount to a txt file so i can have like the following things

money = 100
ban = 0
warn = 0
kicks = 0
name = assasin
password = *********
adminlevel

and then i have that put into my script and stuff coz i dont evan know how to make that file yet do anything ealse


Re: save player info - Energyzer - 24.08.2009

That would be updated automatically in the ScriptFiles ( users ) .ini. I give you some example:

You save the accounts, and the info saved in the .ini scriptfiles, save something similar to this:

Key=1234 // Password
Level=300000 // Level
AdminLevel=1337 // Admin Level
DonateRank=0 // Premium
UpgradePoints=0
ConnectedTime=4
Registered=1

And other than you add.

But, when the player leave the server, if you use the SaveAccounts();, i think all accounts saved.

Anything more, tell me,


Re: save player info - sggassasin - 24.08.2009

ok

but umm how would i add the following things to the list ..

Money
Bank (money)
Kills
Warnings

and what is the admin called they use for that user .ini


Re: save player info - MenaceX^ - 24.08.2009

Er, what do you all doing?..

Just make a saving varialbe in OnPlayerDisconnect..


Re: save player info - Energyzer - 24.08.2009

First, what GameMode you use?


Re: save player info - sggassasin - 24.08.2009

Quote:
Originally Posted by Energyzer
First, what GameMode you use?
im starting from scratch so no gamemode


Re: save player info - MenaceX^ - 24.08.2009

Read some guides, look trought other scripts. Then if you have problems come and ask again..


Re: save player info - sggassasin - 24.08.2009

i have been looking and i dont get it


Re: save player info - Energyzer - 24.08.2009

You can download other GameMode and look, or use the search button and look some scripts similar to this. (pKill, pAccount, etc) as Said menacex, do that and if you have problems, ask...

Good Luck


Re: save player info - Energyzer - 24.08.2009

Quote:
Originally Posted by sggassasin
i have been looking and i dont get it
I recommend you to start editing another script and not create one from scratch, so you can adjust as you are prepared, then in the meantime I think for you that are new to this is a waste of time.


Re: save player info - sggassasin - 24.08.2009

ok i found one but i whant to combine it with a bank script that i found coz i still wahnt to make my game mode from scratch so im gonna use seifs script and a bank script but i carnt combine them together iv got evrething done but it wont save the bank money

so could someone help