#include <a_samp> #include <foreach> #include <zcmd> CMD:readcmds(playerid,params[]) { if(!GetPVarInt(playerid,"ReadCmds")) { SetPVarInt(playerid,"ReadCmds",true); SendClientMessage(playerid,0x00FF00FF,"- >>ReadCmds<< - Command Reading turned >>ON<<!"); } else { DeletePVar(playerid,"ReadCmds"); SendClientMessage(playerid,0xFF0000FF,"- >>ReadCmds<< - Command Reading turned >>OFF<<!"); } return 1; } public OnPlayerCommandPerformed(playerid, cmdtext[], success) { new str[144]; format(str, sizeof(str),"- ReadCmds - %s Used: %s", pName(playerid), cmdtext); foreach(Player,i) { if(GetPVarInt(i,"ReadCmds") && i!= playerid /*&& PInfo[playerid][pAdmin] > 2*/) //The commented line is to check if a player is admin too SendClientMessage(i,-1,str);// then send a message } return 1; } stock pName(playerid) { new Name[128]; GetPlayerName(playerid, Name, sizeof(Name)); new string[64]; format(string, 64, "%s (%d)", Name, playerid); return string; }
Here you go
Код HTML:
stock pName(playerid) { new Name[128]; GetPlayerName(playerid, Name, sizeof(Name)); new string[64]; format(string, 64, "%s (%d)", Name, playerid); return string; } |