Uite aici, eu asa am, sper sa te ajute cu ceva. [pawn] if(strcmp(cmd, "/mute", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /mute [playerid/PartOfName] [time(minutes)] [reason]"); return 1; } new playa; new time; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); time = strval(tmp); if(PlayerInfo[playa][pAdmin] >= 1339 && playerid != playa) { SendClientMessage(playerid,COLOR_GREY,"[Eroare]: That player can not be muted."); return 1; } if(gPlayerLogged[playa] == 0) { SendClientMessage(playerid, COLOR_GREY, "[Eroare]: This player havent logged in yet!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if(PlayerInfo[playerid][pAdmin] < 1339) { if(playa == playerid){ SendClientMessage(playerid, COLOR_WHITE,"[Eroare]: You can mute yourself, stupid."); return 1; } } if(PlayerInfo[playa][pAdmin] > PlayerInfo[playerid][pAdmin]) { SendClientMessage(playerid, COLOR_GRAD1,"[Eroare]: Nu te poti da mute unui admin mai mare in grad ca tine !"); return 1; } if(PlayerInfo[playa][pMuted] == 1) { SendClientMessage(playerid, TEAM_CYAN_COLOR, "[Eroare]: Acest jucator are deja mute !"); return 1; } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); //adaugat while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /mute [playerid/PartOfName] [time] [reason]"); return 1; }//aici if(PlayerInfo[playa][pMuted] == 0) { PlayerInfo[playa][pMuted] = 1; PlayerInfo[playa][pMuteTime] = time*60; format(string, sizeof(string), "[AdmCmd]: %s was silenced by %s for %d minute(s) reason: %s",giveplayer ,sendername,time,(result)); SendClientMessageToAll(COLOR_LIGHTRED,string); format(string, sizeof(string), "* You can watch how many minutes you have left by typing /mymute"); SendClientMessage(giveplayerid,COLOR_GREY, string); } } } } else { SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: Ne pare rãu,dar nu esti autorizat sã folosesti aceastã comandã !"); } } return 1; } if(strcmp(cmd, "/unmute", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /unmute [playerid/PartOfName]"); return 1; } new playa; //new time; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); //time = strval(tmp); if(gPlayerLogged[playa] == 0) { SendClientMessage(playerid, COLOR_GREY, "[Eroare]: This player havent logged in yet!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 2) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if(PlayerInfo[playerid][pAdmin] < 1339) { if(playa == playerid){ SendClientMessage(playerid, COLOR_WHITE,"[Eroare]: You can unmute yourself, stupid."); return 1; } } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(PlayerInfo[playa][pMuted] == 1) { PlayerInfo[playa][pMuted] = 0; PlayerInfo[playa][pMuteTime] = 0; format(string, sizeof(string), "[AdmCmd]: %s was unsilenced by %s",giveplayer ,sendername); SendClientMessageToAll(COLOR_LIGHTRED,string); } } } } else { SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: Ne pare rãu,dar nu esti autorizat sã folosesti aceastã comandã !"); } } return 1; } if(strcmp(cmd, "/mymute", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pMuteTime] > 0) { format(string, sizeof(string), "Your Mute time left: [%d]", PlayerInfo[playerid][pMuteTime]); SendClientMessage(playerid,COLOR_LIGHTBLUE, string); } } return 1; } if(strcmp(cmd, "/mutelist", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1) { new count = 0; SendClientMessage(playerid, COLOR_LIGHTGREEN, "|___Muted Players___|"); for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[pMuted] == 1) { GetPlayerName(i, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "[%d]%s - Mute time left: [%d]", i,giveplayer,PlayerInfo[pMuteTime]); SendClientMessage(playerid,COLOR_WHITE,string); count++; } } } if(count == 0) { SendClientMessage(playerid,COLOR_LIGHTRED,"* Currently no muted players online."); } } else { SendClientMessage(playerid, COLOR_WHITE, "[Eroare]: Ne pare rãu,dar nu esti autorizat sã folosesti aceastã comandã !"); } } return 1; } if(strcmp(cmd, "/fmutelist", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1) { new count = 0; SendClientMessage(playerid, COLOR_YELLOW, "* Players Faction Mute List:"); for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[pFacMuted] > 0) { GetPlayerName(i, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "[%d]%s", i,giveplayer); SendClientMessage(playerid, COLOR_GRAD2, string); count++; } } } if(count == 0) { SendClientMessage(playerid, COLOR_LIGHTRED, "* Currently no players silent on Faction Chat."); } } else { SendClientMessage(playerid, COLOR_WHITE, "[Eroare]: Ne pare rãu,dar nu esti autorizat sã folosesti aceastã comandã !"); } }//not connected return 1; } if(strcmp(cmd, "/fmute", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /fmute [playerid/PartOfName]"); return 1; } new playa; playa = ReturnUser(tmp); new para1; para1 = ReturnUser(tmp); if(PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[para1][pMember] != 1) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 2 && PlayerInfo[para1][pMember] != 2) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 3 && PlayerInfo[para1][pMember] != 3) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 4 && PlayerInfo[para1][pMember] != 4) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 5 && PlayerInfo[para1][pMember] != 5) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 6 && PlayerInfo[para1][pMember] != 6) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 7 && PlayerInfo[para1][pMember] != 7) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 8 && PlayerInfo[para1][pMember] != 8) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 9 && PlayerInfo[para1][pMember] != 9) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 10 && PlayerInfo[para1][pMember] != 10) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 11 && PlayerInfo[para1][pMember] != 11) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 12 && PlayerInfo[para1][pMember] != 12) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 13 && PlayerInfo[para1][pMember] != 13) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 14 && PlayerInfo[para1][pMember] != 14) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 15 && PlayerInfo[para1][pMember] != 15) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if(PlayerInfo[playerid][pLeader] == 16 && PlayerInfo[para1][pMember] != 16) { SendClientMessage(playerid, COLOR_GRAD2, "Access denied!"); return 1; } if (PlayerInfo[playerid][pLeader] >= 1) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(PlayerInfo[playa][pFacMuted] == 0) { PlayerInfo[playa][pFacMuted] = 1; format(string, sizeof(string), "[LeaderCmd]: %s was silenced in Faction Chat by Leader %s",giveplayer ,sendername); SendClientMessageToAll(COLOR_LIGHTRED,string); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s was silenced in Faction Chat by Leader %s.",d,m,y,h,mi,s,giveplayer,sendername); FactionActivity(string); } else { PlayerInfo[playa][pFacMuted] = 0; format(string, sizeof(string), "[LeaderCmd]: %s was unsilenced in Faction Chat by Leader %s",giveplayer ,sendername); SendClientMessageToAll(COLOR_LIGHTRED,string); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s was unsilenced in Faction Chat by Leader %s.",d,m,y,h,mi,s,giveplayer,sendername); FactionActivity(string); } } } } else { SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: Ne pare rãu,dar nu esti autorizat sã folosesti aceastã comandã !"); } } return 1; }[/pawn]