cmd logs
#1

i want to do logs to cmd but im using zcmd... how can i do the admins will get the cmd logs if they are using the command /logs [on/off]

but i dont want to put this function in every command... i want to make it once and its will effect all the commands
for example:

pawn Код:
CMD:heal(playerid,params[]){
if(!Logged{playerid}) return Ban(playerid);
if(AdminLevel <1)return MSG(playerid,C_RED,"[ERROR] {FF6969}You not allowed to use this command!");
if(sscanf(params,"u",p1)) return MSG(playerid,C_RED,"[ERROR] {ff6969}USAGE: /HEAL <ID>");
SetPlayerHealth(p1,100);
SetPlayerArmour(p1,100);
MSG(playerid,C_GREEN,"Done");
MSG(playerid,C_GREEN,"You healed by an admin");
format(String,sizeof(String),"[Heal] %s healed %s",GetName(playerid),GetName(p1));
for(new i=0;i<MAX_PLAYERS;i++)
if(IsPlayerAdmin(i)) return MSG(playerid,-1,String);
return 1;}
I will need to add this lines every command... and i want to make it only one time and its will effect on all the commands

pawn Код:
format(String,sizeof(String),"[Heal] %s healed %s",GetName(playerid),GetName(p1));
for(new i=0;i<MAX_PLAYERS;i++)
if(IsPlayerAdmin(i)) return MSG(playerid,-1,String);
Reply
#2

bump
Reply
#3

pawn Код:
stock Logs()

format(String,sizeof(String),"[Heal] %s healed %s",GetName(playerid),GetName(p1));
for(new i=0;i<MAX_PLAYERS;i++)
if(IsPlayerAdmin(i)) return MSG(playerid,-1,String);

}
return 1;
}
Try add this in the bottom, then you only need to add Logs(playerid); in every cmd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)