Help me with this
#1

How can i make script that creates ini file with player’s ip and in that file saves all nicknames that are joined with this ip
Reply
#2

Can you try that?

PHP код:
//Defines
#define FILE_NAME "here name of the file ini" //File ini directory
//News
new File:hFile;
stock SaveIPuser(playerid
{
    new 
ip[64], pname[24], string[128], str[128];
    
hFile fopen(FILE_NAMEio_write);
    
GetPlayerIp(playeridip64); //Getting the IP of the player
    
GetPlayerName(playeridpname24); // The name of the player
    
format(str256"Pseudo: %s | IP: %s\n\r"pnameip); // The format
    
    
while(fread(hFilestring)) //Reading the file..
    
{
        if(
strcmp(stringpnamefalsestrlen(pname)) == 0// To check if the players name is in the file
        

            
fwrite(hFilestr); // write the string
        
}
        else
        {
            
fwrite(hFilestr);
        }
    }
    
fclose(hFile);

More information? here
Reply
#3

Quote:
Originally Posted by Maximun
Посмотреть сообщение
Can you try that?

PHP код:
//Defines
#define FILE_NAME "here name of the file ini" //File ini directory
//News
new File:hFile;
stock SaveIPuser(playerid
{
    new 
ip[64], pname[24], string[128], str[128];
    
hFile fopen(FILE_NAMEio_write);
    
GetPlayerIp(playeridip64); //Getting the IP of the player
    
GetPlayerName(playeridpname24); // The name of the player
    
format(str256"Pseudo: %s | IP: %s\n\r"pnameip); // The format
    
    
while(fread(hFilestring)) //Reading the file..
    
{
        if(
strcmp(stringpnamefalsestrlen(pname)) == 0// To check if the players name is in the file
        

            
fwrite(hFilestr); // write the string
        
}
        else
        {
            
fwrite(hFilestr);
        }
    }
    
fclose(hFile);

More information? here
Doesn't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)