SA-MP Forums Archive
cmd logs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: cmd logs (/showthread.php?tid=532170)



cmd logs - Lirbo - 16.08.2014

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);



Re: cmd logs - Lirbo - 24.08.2014

bump


Re: cmd logs - Lynet - 24.08.2014

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.