Help with a /ban cmd
#2

Код:
if (strcmp(cmdtext, "/ban", true) == 0)
{
   // other code goes here
   new File: file, playername[32],filename[36];
   GetPlayerName(playerid, playername, 32);
   format (filename, 36, "%s.ban", playername);

   file = fopen(filename, io_readwrite);
   fwrite(file, "1"); // make sure it's filled with something, doesn't really matter though
   fclose(file);

   return 1;
}
Код:
// in OnPlayerConnect

new playername[32],filename[36];
GetPlayerName(playerid, playername, 32);
format (filename, 36, "%s.ban", playername);
if (fexist(filename))
   Ban(playerid); // or kick, whatever you want
Reply


Messages In This Thread
Help with a /ban cmd - by tomnidi - 12.02.2009, 10:53
Re: Help with a /ban cmd - by [RP]Rav - 12.02.2009, 11:09
Re: Help with a /ban cmd - by tomnidi - 12.02.2009, 14:52
Re: Help with a /ban cmd - by MenaceX^ - 12.02.2009, 15:02
Re: Help with a /ban cmd - by tomnidi - 12.02.2009, 15:05
Re: Help with a /ban cmd - by [RP]Rav - 12.02.2009, 15:08
Re: Help with a /ban cmd - by Think - 12.02.2009, 16:11

Forum Jump:


Users browsing this thread: 1 Guest(s)