Problem Reason save Date
#6

pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pScore,
    pBan,
    pDeaths,
    pBannedReason[129] //edit that line
}
pawn Код:
CMD:ban(playerid,params[])
{
new Joueur[MAX_PLAYER_NAME];
new Admin[MAX_PLAYER_NAME];
new id;
new raison[64];
new string[128];
new Heure,Minute,Seconde;
new Jour,Mois,Anne;
getdate(Jour,Mois,Anne);
gettime(Heure,Minute,Seconde);
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,0xC0C0C0FF,"Vous n'avez pas accиs а cette commande.");
if(sscanf(params,"us[64]",id,raison)) return SendClientMessage(playerid,0xC0C0C0FF,"Usage : /ban [id] [raison]");
GetPlayerName(playerid,Admin,sizeof(Admin));
GetPlayerName(id,Joueur,sizeof(Joueur));
format(string,sizeof(string),"Le joueur %s(%d) a йtй banni par l'Administrateur %s(%d) Raison: %s Heure: %02d:%02d:%02d Date: %02d/%02d/%d",Joueur,id,Admin,playerid,raison,Heure,Minute,Seconde,Anne,Mois,Jour);
SendClientMessageToAll(0x8395BEFF,string);
SetTimerEx("ban",1000,false,"id",id);
PlayerInfo[playerid][pBan] == 1; //edited part instead of using ban(playerid); because that directly ban his ip every time he will join he will be kicked.
AddLog(string,"Scriptedfilesfoldername/Yournotepadname.txt");
new INI:File = INI_Open(UserFile(playerid))
INI_WriteString(File,"Banned reason",raison);
INI_Close(File);
return 1;
}
And add that anywhere in your script
pawn Код:
stock AddLog(const string[], const logfile[])
{
    new str[150],
        day, month, year,
        hour, minute, second
    ;
    getdate(year, month, day);
    gettime(hour, minute, second);

    format(str, 150, "[%02d-%02d-%04d %02d:%02d:%02d] %s\r\n", day, month, year, hour, minute, second, string);
    WriteInFile(str, logfile);
    return 1;
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    new string[126];
    format(string,sizeof(string),"You are banned from playeing in server reason : %s",pBannedReason);
    if(PlayerInfo[playerid][pBan] == 1) return ShowPlayerDialog(playerid,23333,DIALOG_STYLE_MSGBOX,"Banned",string,"ok","");
    return 1;
}
Ps: didn't test that but should work
Reply


Messages In This Thread
Problem Reason save Date - by Xprototype - 25.10.2013, 19:45
Re : Problem Reason save Date - by Xprototype - 25.10.2013, 20:05
Re : Problem Reason save Date - by Xprototype - 25.10.2013, 20:43
Re: Problem Reason save Date - by SilentSoul - 25.10.2013, 20:58
Re : Problem Reason save Date - by Xprototype - 25.10.2013, 21:00
Re: Problem Reason save Date - by SilentSoul - 25.10.2013, 21:12
Re : Problem Reason save Date - by Xprototype - 25.10.2013, 21:26
Re : Problem Reason save Date - by Xprototype - 25.10.2013, 21:33
Re: Problem Reason save Date - by SilentSoul - 25.10.2013, 21:36
Re : Problem Reason save Date - by Xprototype - 25.10.2013, 21:40

Forum Jump:


Users browsing this thread: 2 Guest(s)