SA-MP Forums Archive
Save jailer name - 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: Save jailer name (/showthread.php?tid=597093)



Save jailer name - KillerDVX - 26.12.2015

Hello guys,
Today, I've made a command which I can get the name of Admin who jailed a player and the reason of it.
It works perfectly, but the main problem that when the player's disconnect, and reconnect, I can't get the name of the admin and the reason. THO..

this is the command to view players in jail :

PHP код:
dcmd_prison(playerid,params[])
{
    
#pragma unused params
    
new string[170];
    
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_PRISON_]]");
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
JailAdminTime[i] >= 1)
            {
                
format(string,sizeof(string),"[PRISON ADMIN] {FFFFFF}%s(%d): Emprisonnй par: {FF0000}%s {FFFFFF}Raison: {FF0000}%s.",PlayerName(i),i,jailed[i][administrateur],jailed[i][reason_jailed]);
                
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            }
        }
    }
    return 
1;




Re: Save jailer name - SaltySandy - 26.12.2015

You locally save it, but you do not write the strings out to somewhere. Perhaps link it up with a database and have the command to write in there?


Re: Save jailer name - KillerDVX - 26.12.2015

I'm not using MYSQL for my server, I'm using dutil as a registration system.


Re: Save jailer name - SaltySandy - 26.12.2015

Where does it save? I can't seem to figure that out in your command.


Re: Save jailer name - KillerDVX - 26.12.2015

Hm.. Actually I'm using dudb for registration system as I said, so I don't know how to save it as a string. However, I have the enum for it.


Re: Save jailer name - SaltySandy - 26.12.2015

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
Hm.. Actually I'm using dudb for registration system as I said, so I don't know how to save it as a string. However, I have the enum for it.
Hmm.. I've not yet used that to register anything. Perhaps there's some info in the documentation? Right now, you can't recall anything, as the system is not writing it out. When the user logs out, his data is lost ( as-in who jailed him/her ). You have to find a fix for that.


Re: Save jailer name - KillerDVX - 26.12.2015

That what I'm searching for.. a way to save my reason as a string..


Re: Save jailer name - SaltySandy - 26.12.2015

Hmm.. perhaps convert it into a string, and save that string to an external file? You might be able to read it out.. I'd suggest to start working with SQL, as it's faster and can be safer.