SA-MP Forums Archive
Y_ini command - 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: Y_ini command (/showthread.php?tid=346107)



Y_ini command - Mr L - 27.05.2012

Hello guys, well i was using dini on my script i have this command,

Код:
if(strcmp(cmd, "/unban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new string2[256];
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /unban [full name]");
			if (PlayerInfo[playerid][pServerAdmin] >= 3)
			{
			    format(string, sizeof(string), "%s.ini",tmp);
	    	    if(fexist(string))
	    	    {
	    	        new File:hFile = fopen(string, io_append);
	    	        if(dini_Int(string, "Banned") > 0)
	    	        {
						new cban[6], var[128];
	    	            format(cban, sizeof(cban),"None");
	    	            format(var, 32, "BReason=None\n", PlayerInfo[playerid][pBReason]);fwrite(hFile, var);
	    	            format(var, 32, "Banned=0\n", PlayerInfo[playerid][pABanned]);fwrite(hFile, var);
	    	            format(var, 32, "Warns=0\n", PlayerInfo[playerid][pAWarns]);fwrite(hFile, var);
	    	            fclose(hFile);
	    	            string2 = dini_Get(string, "IP");
	    	            format(string, sizeof(string),"unbanip %s", string2);
        	            SendRconCommand(string);
            		    SendRconCommand("reloadbans");
            		    format(string, 256, "SERVER: %s unbanned account '%s' and IP '%s'.",PlayerName(playerid),tmp,string2);
                        ABroadCast(COLOR_RED, string, 1);
            		    return 1;
            	    }
            	    else
            	    {
            	        SendClientMessage(playerid, COLOR_GRAD2, "That player is not banned.");
            	        string2 = dini_Get(string, "IP");
            		    format(string, sizeof(string), "unbanip %s", string2);
            		    SendRconCommand(string);
            		    SendRconCommand("reloadbans");
            		    return 1;
            	    }
	    	    }
	    	    else SendClientMessage(playerid, COLOR_GRAD2, "That player does not exist!");
			}
		}
		return 1;
	}
And i want to change it to y_ini can anyone help me please? thanks guys.