Yini read
#8

Quote:
Originally Posted by saffierr
View Post
Can someone tell me how to fix this, how to read from the // file

PHP Code:
CMD:unban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return 0;
    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_YELLOWGREEN"Error: You are not authorized to use this command.");
    new 
string[75], user[128];
    if(
sscanf(params"s[128]"user)) return SendClientMessage(playeridCOLOR_ORANGE"Usage: /unban [playername]");
     
format(stringsizeof string"/Users/%s.txt"user);
    if(
fexist(string))
    {
        new 
INI:File INI_Open(string);
      
//  if(INI_WriteInt(File, "Banned", PlayerInfo[string][Banned]) == 0) return SendClientMessage(playerid, COLOR_RED, "Error: The player is not banned!");
        
printf("Userfile opened");
        
INI_SetTag(File"PlayerData");
        
INI_WriteInt(File"Banned"0);
        
printf("User unbanned");
        
INI_Close(File);
        
printf("File closed");
        
format(stringsizeof string"You have succesfully unbanned the player.");
        
SendClientMessage(playeridCOLOR_YELLOWstring);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"Error: The user is not found in the database!");
    }
    return 
1;

Change
PHP Code:
//  if(INI_WriteInt(File, "Banned", PlayerInfo[string][Banned]) == 0) return SendClientMessage(playerid, COLOR_RED, "Error: The player is not banned!");
if(INI_Int("Banned",PlayerInfo[string][Banned])
//Close File
//Now Check The Variable
If(PlayerInfo[string][Banned] == 0) return SendClientMessage(playeridCOLOR_RED"Error: The player is not banned!"); 
Reply


Messages In This Thread
Yini read - by saffierr - 19.02.2016, 21:26
Re: Yini read - by Jefff - 19.02.2016, 21:38
Re: Yini read - by saffierr - 19.02.2016, 21:56
Re: Yini read - by StreetboyBalkan - 19.02.2016, 22:01
Re: Yini read - by saffierr - 19.02.2016, 22:25
Re: Yini read - by StreetboyBalkan - 21.02.2016, 18:15
Re: Yini read - by StreetboyBalkan - 23.02.2016, 15:04
Re: Yini read - by Amunra - 23.02.2016, 16:00
Re: Yini read - by Jefff - 23.02.2016, 16:28

Forum Jump:


Users browsing this thread: 4 Guest(s)