18.08.2011, 14:22
can someone help me? if i type etc /mute 1(player is connected) it show's " Usage: /mute [id] " help?
My Code!
same with freeze, unfreeze and unmute :P
My Code!
Код:
CMD:mute(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new cmd[256],tmp[256],cmdtext[256],idx; cmd = strtok(cmdtext, idx); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, " Usage: /mute [id] "); new giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, " Player not connected ! "); new name[24], name2[24], str[128]; GetPlayerName(playerid, name, 24); GetPlayerName(giveplayerid, name2, 24); format(str, sizeof str, "*Admin %s has muted %s ", name, name2); SendClientMessageToAll(COLOR_PINK, str); Muted[giveplayerid] = 1; return 1; } else return SendClientMessage(playerid, COLOR_RED, "Admin command!"); }
Код:
CMD:freeze(playerid, params[]) { if (IsPlayerAdmin(playerid)) { new cmdtext[256]; if(!strlen(cmdtext[8])) { SendClientMessage(playerid, COLOR_RED, "Usage: /freeze [playerid]"); return 1; } new ID = strval(cmdtext[8]); new strv[170]; new tmp[256]; new giveplayerid = strval(tmp); new name2[24]; if(IsPlayerConnected(ID)) { GetPlayerName(giveplayerid, name2, 24); format(strv, 170, "*%s has been frozen by Admin.", name2); SendClientMessageToAll(COLOR_PINK, strv); TogglePlayerControllable( ID ,0); } } return SendClientMessage(playerid, COLOR_RED, "Admin command!"); }