14.02.2010, 14:26
How can i log all command information?
And how can i log all all bans/kicks/admin cmds
And how can i log all all bans/kicks/admin cmds
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 |
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; }