please let me know
#1

How can i log all command information?


And how can i log all all bans/kicks/admin cmds
Reply
#2

Quote:
Originally Posted by Death is Here
you can simply print data on your serverlog by using the function "printf" on your command.

https://sampwiki.blast.hk/wiki/Printf
Can you tell me how i can do that for a /ban cmd?

Код:
if(strcmp(cmd, "/adban", true) == 0 && PlayerAdminLevel[playerid] == 1337) // Admin Ban
	{
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /adban (id)");
  return 1;
  }
  giveplayerid = strval(tmp);
  
  if(!IsNumeric(tmp)) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /adban (id) ID Must be a number");
  return 1;
  }
  new output[255];
  strmid(output,cmdtext,9,strlen(cmdtext));
  if (IsPlayerConnected(giveplayerid)) {
  SetPlayerInterior(giveplayerid,0);
  SetPlayerPos(giveplayerid,-127.0526,2258.4316,29.4287);
  SetPlayerFacingAngle(giveplayerid,217.0701);
  SetCameraBehindPlayer(giveplayerid);
	SetTimer("BanExplosionone",500,0);
	AdminKilled[giveplayerid] =1;
  GetPlayerName(giveplayerid, string, 24);
  format(string, 100, "**(ADMIN BAN)** %s(%d) %s", string,giveplayerid,output);
  SendClientMessageToAll(0xFF7F50AA, string);
  printf("%s", string);
  if(udb_Exists(PlayerName(giveplayerid)) && PLAYERLIST_authed[giveplayerid]) {
	dUserSetINT(PlayerName(giveplayerid)).("nameban",1);
	}
  SendClientMessage(giveplayerid,COLOR_RED,"||| YOU HAVE BEEN BANNED FROM THIS SERVER");
  SendClientMessage(giveplayerid,COLOR_RED,"||| You can appeal this action at our website");
  SendClientMessage(giveplayerid,COLOR_RED,"||| Visit www.lvrcr.com for details");
  SendClientMessage(giveplayerid,COLOR_RED,"||| Please note that we do not unban hackers/cheaters or repeat offenders");
  Banning[giveplayerid] = 1;

  }
  else {
  format(string, sizeof(string), "ID (%d) Is not an active player", giveplayerid);
  SendClientMessage(playerid, COLOR_ERROR, string);
  }
  return 1;
  }
Heres an example of a /ban cmd i found

Reply
#3

Just download an admin filterscript.
Thatґs the easiest way.
Reply
#4

I already have admin cmds in my GM and i'd just like to learn how to use the printf..........


Reply
#5

Thank you, i see how its done.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)