18.02.2015, 02:02
I am trying to get this to work,its from ladmin i want to know how it works so i am testing it on fresh script but it doesn't works,i want to know about the message thing,the messagetoadmins forward works but not cmd one
Код:
CMD:announce(playerid,params[]) { if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 4 to announce."); new string[128],pText[64]; if(sscanf(params,"s[128]",pText)) return SendClientMessage(playerid,STEALTH_BLUE,"USAGE: /announce [text]"); format(string,sizeof(string),"%s",pText); GameTextForAll(string,3000,3); CMDMessageToAdmins(playerid,"ANNOUNCE"); return 1; } forward MessageToAdmins(color,const string[]); public MessageToAdmins(color,const string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) if (PInfo[i][Level] >= 1) SendClientMessage(i, color, string); } return 1; } stock CMDMessageToAdmins(playerid,command[]) { if(ServerInfo[AdminCmdMsg] == 0) return 1; new string[128]; GetPlayerName(playerid,string,sizeof(string)); format(string,sizeof(string),"[ADMIN] %s has used the command %s",string,command); return MessageToAdmins(COLOR_INFOTEXT,string); }