save kick and ban
#1

how to save the kick and ban in a notebook


codes:

PHP код:
CMD:ban(playerid,params[])
{
         if(
PlayerInfo[playerid][cAdmin] >= 3){
         new 
ID,gname[MAX_PLAYER_NAME],string[125],reason[70];
         if(
sscanf(params,"us[70]",ID,reason)) return SendClientMessage(playerid,-1"*Uso: /ban [playerid] [razón]");
         if(
ID == INVALID_PLAYER_ID || !IsPlayerConnected(ID)) return SendClientMessage(playerid, -1"La ID ingresada es incorrecta");
         
GetPlayerName(ID,gname,sizeof(gname));
         
format(stringsizeof(string), "El usuario %s(%d) ha sido baneado por el administrador %s(%d) (razón: %s)"gnameIDNombre(playerid), playeridreason);
         
SendClientMessageToAll(COLOR_KBstring);
         
Ban(ID);}
         return 
1;
}
CMD:kick(playerid,params[])

         if(
PlayerInfo[playerid][cAdmin] >= 3){
         new 
ID,gname[MAX_PLAYER_NAME],string[125],reason[70];
         if(
sscanf(params,"us[70]",ID,reason)) return SendClientMessage(playerid,-1"*Uso: /kick [playerid] [razón]");
         if(
ID == INVALID_PLAYER_ID || !IsPlayerConnected(ID)) return SendClientMessage(playerid, -1"La ID ingresada es incorrecta");
         
GetPlayerName(ID,gname,sizeof(gname));
         
format(stringsizeof(string), "El usuario %s(%d) ha sido expulsado por el administrador %s(%d) (razón: %s)"gnameIDNombre(playerid), playeridreason);
         
SendClientMessageToAll(COLOR_KBstring);
         
Kick(ID);}
         return 
1;

Reply
#2

Use y_ini
Reply
#3

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Use y_ini
I do not know how to do it
Reply
#4

Hello!

What do you mean:
Quote:

in a notebook

?


Do you want a document where you can check which people are kicked / banned?
If so you can use fwrite, fread, fexists and so on.
Reply
#5

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

What do you mean:

?


Do you want a document where you can check which people are kicked / banned?
If so you can use fwrite, fread, fexists and so on.
If I want a function that stores the kicks and bans in a text document, but I do not know how to do it
Reply
#6

PHP код:
CMD:ban(playerid,params[])
{
         if(
PlayerInfo[playerid][cAdmin] >= 3){
         new 
ID,gname[MAX_PLAYER_NAME],string[125],reason[70];
         if(
sscanf(params,"us[70]",ID,reason)) return SendClientMessage(playerid,-1"*Uso: /ban [playerid] [razуn]");
         if(
ID == INVALID_PLAYER_ID || !IsPlayerConnected(ID)) return SendClientMessage(playerid, -1"La ID ingresada es incorrecta");
         
GetPlayerName(ID,gname,sizeof(gname));
         
format(stringsizeof(string), "El usuario %s(%d) ha sido baneado por el administrador %s(%d) (razуn: %s)"gnameIDNombre(playerid), playeridreason);
         
SendClientMessageToAll(COLOR_KBstring);
         
Ban(ID);
         new 
File:kickfile fopen("kicks.txt"io_write);
         if(
kickfile)
         {
            
fwrite(kickfile,string);
            
fclose(kickfile);
         }}
         return 
1;

You have to have the "kicks.txt" in your scriptfiles folder.
Try this.
Reply
#7

ok I'm going to test it and tell it if it's saved thanks for all the help <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)