16.07.2011, 09:08
(
Последний раз редактировалось OleKristian95; 23.07.2011 в 12:02.
Причина: Making a better title so people maybe understand me better ^^
)
Hi all I'm back an need help ^^
I want to make my /mute command not only /mute <ID> <Reason> but /Mute <ID> <Minutes> <Reason>
Is this hard to do? ^^ I would like to learn how to do it, btw here is the code:
I want to make my /mute command not only /mute <ID> <Reason> but /Mute <ID> <Minutes> <Reason>
Is this hard to do? ^^ I would like to learn how to do it, btw here is the code:
Код:
CMD:mute(playerid,params[]) { if(AccInfo[playerid][LoggedIn] == 1) { if(AccInfo[playerid][Level] >= 2) { new tmp[256]; new tmp2[256]; new Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index); if(isnull(params)) return Inter_SendClientMessage(playerid, LIGHTBLUE2, "Usage: /mute [PlayerID] [Reason]") && Inter_SendClientMessage(playerid, orange, "Function: Will mute the specified player"); new playername[MAX_PLAYER_NAME]; new adminname [MAX_PLAYER_NAME]; new player1, string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { if(AccInfo[player1][Muted] == 0) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); SendCommandToAdmins(playerid,"Mute"); PlayerPlaySound(player1,1057,0.0,0.0,0.0); AccInfo[player1][Muted] = 1; AccInfo[player1][MuteWarnings] = 0; if(strlen(tmp2)) { format(string,sizeof(string),"|- You have been Muted by Administrator %s | Reason: %s -|",adminname,params[2]); Inter_SendClientMessage(player1,blue,string); format(string,sizeof(string),"|- You have Muted %s | Reason: %s -|", playername,params[2]); return Inter_SendClientMessage(playerid,BlueMsg,string); } else { format(string,sizeof(string),"|- You have been muted by Administrator %s | No Specified Reason! -|",adminname); Inter_SendClientMessage(player1,blue,string); format(string,sizeof(string),"|- You have Muted %s -|", playername); return Inter_SendClientMessage(playerid,BlueMsg,string); } } else return Inter_SendClientMessage(playerid, red, "ERROR: Player is already muted"); } else return Inter_SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin"); } else return ErrorMessages(playerid, 1); } else return Inter_SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); }