Need help with ban command
#2

You aren't getting the person's ban information yet - you need to open the person's character file and assign something to PInfo[playerid][Banned] before you check it to see if they're banned or not.

Код:
new filename[64], name[24];
GetPlayerName(playerid, name, sizeof(name));
format(filename, sizeof(fiilename), "/scriptfiles/players/%s.txt", name);
if(fexist(filename)) {
	new lines_read = 0;
	new File:f = fopen(filename, io_read);		//open file
	while(fread(f, line))		//read from file {
		switch(lines_read) {
			case 0:	//This is the first line in the file, change it to whatever the line number the ban number is on. {
                                PInfo[playerid][Banned] = 
                         }
                 }
         }
        fclose(f);
}

if(PInfo[playerid][Banned] == 1){
           SendClientMessage(playerid, 0xFF444499, "You are banned from this server if this is a mistake appeal at our forums");
           Kick(playerid);
}
I'll let you figure out the rest.
Reply


Messages In This Thread
Need help with ban command - by Biess - 01.02.2013, 17:38
Re: Need help with ban command - by Alternative112 - 01.02.2013, 19:08
Re: Need help with ban command - by Biess - 02.02.2013, 06:45
Re: Need help with ban command - by iDrEaMzZxo - 02.02.2013, 06:51
Re: Need help with ban command - by Biess - 02.02.2013, 16:52
Re: Need help with ban command - by T0pAz - 02.02.2013, 17:00
Re: Need help with ban command - by Biess - 02.02.2013, 17:05
Re: Need help with ban command - by Biess - 03.02.2013, 11:10
Re: Need help with ban command - by Biess - 04.02.2013, 05:16
Re: Need help with ban command - by Threshold - 04.02.2013, 07:18

Forum Jump:


Users browsing this thread: 1 Guest(s)