save player info
#1

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
Reply
#2

Quote:

ps.im not useing a difrent register system

Huh? How would I even know what you use?
Reply
#3

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;
    }
Reply
#4

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
Reply
#5

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
Reply
#6

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
Reply
#7

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,
Reply
#8

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
Reply
#9

Er, what do you all doing?..

Just make a saving varialbe in OnPlayerDisconnect..
Reply
#10

First, what GameMode you use?
Reply
#11

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

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

i have been looking and i dont get it
Reply
#14

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
Reply
#15

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.
Reply
#16

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)