19.05.2014, 15:13
Код:
if(strcmp(cmd, "/mute", true) == 0) { if(IsPlayerConnected(playerid)) { new string[456]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00CCFF}(( {FFCC00}Exemplu folosire: {FF9930} /mute [id] [minute] {00CCFF}))"); return 1; } new playa; new time; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); time = strval(tmp); if (PlayerInfo[playerid][Administrator]) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if (time > 1) { format(string, sizeof(string), "(LS-CP) {CC0033}Jucatorul %s a primit mute de la administratorul %s pentru %d minute!", giveplayer, sendername, time); SendClientMessageToAllEx(COLOR_GRAD1, string); } if (time == 1) { format(string, sizeof(string), "(LS-CP) {CC0033}Jucatorul %s a primit mute de la administratorul %s pentru %d minut!", giveplayer, sendername, time); SendClientMessageToAllEx(COLOR_GRAD1, string); } PlayerInfo[playa][pMute] = 1; PlayerInfo[playa][pMuteTime] = time*6000; format(string, sizeof(string), "(LS-CP) {00CCFF}(( {FFCC00}Informatie - {FF9930}scrie /mymute pentru a afla timpul ramas din mute {00CCFF}))"); SendClientMessage(playa, COLOR_GRAD1, string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, "{00CCFF}(( {FFCC00}Informatie -{FF9930} nu ai accces la aceasta comanda! {00CCFF}))"); } } return 1; }
/mymute
Код:
if(strcmp(cmd, "/mymute", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pMute] == 1) { new string[256]; new timpramas = PlayerInfo[playerid][pMuteTime] / 60000; format(string, sizeof(string), "~y~Timp ramas din mute ~n~~r~%d~y~ minute ramase",timpramas); GameTextForPlayer(playerid, string, 5000, 1); } } return 1; }