21.08.2014, 09:52
Hey everyone!
I have a problem.
For example, when I write /mute 20 test (ID 20 isn't connected) it says that command /mute is unknown but when I write /settime 20 2 (ID 20 isn't connected) it says that ID isn't valid (that I want to happen to /mute)
Look at my code:
Can you tell me why?
I have a problem.
For example, when I write /mute 20 test (ID 20 isn't connected) it says that command /mute is unknown but when I write /settime 20 2 (ID 20 isn't connected) it says that ID isn't valid (that I want to happen to /mute)
Look at my code:
Код:
CMD:settime(playerid, params[]) { if(AccInfo[playerid][Level] < 3) return ErrorMessages(playerid, 3); //-------------------------------------------------------------------------- new player, amount, l_Str[129], l_Str2[129]; //-------------------------------------------------------------------------- if(sscanf(params, "ud", player, amount)) return SendUsage(playerid, "/SetTime [PlayerID] [Time]"); //-------------------------------------------------------------------------- if(player == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, That player is not connected!"); //-------------------------------------------------------------------------- SetPlayerTime(player, amount, 0), SendCommandToAdmins(playerid, "Set Time"); //-------------------------------------------------------------------------- format(l_Str, sizeof(l_Str), "Administrator %s has setted your time to %d:00!", ReturnName(playerid), amount), SendClientMessage(player, BLUE, l_Str); //-------------------------------------------------------------------------- format(l_Str2, sizeof(l_Str2), "You have setted %s's time to %d:00!", ReturnName(player), amount), SendClientMessage(playerid, BLUE, l_Str2); //-------------------------------------------------------------------------- return 1; } CMD:mute(playerid, params[]) { new pID; //-------------------------------------------------------------------------- if(AccInfo[playerid][Level] < 3) return ErrorMessages(playerid, 3); //-------------------------------------------------------------------------- if(sscanf(params, "uS()[50]", pID, params[0])) return SendUsage(playerid, "/Mute [PlayerID][Reason]"); //-------------------------------------------------------------------------- if(AccInfo[pID][Muted] == 1) return SendError(playerid, "Acest jucator are deja mute!", "This player is already muted"); //-------------------------------------------------------------------------- if(pID != INVALID_PLAYER_ID && pID != playerid && AccInfo[pID][Level] == 0) { ASts[playerid][Mutes] += 1, SendCommandToAdmins(playerid, "Mute"), AccInfo[pID][MuteTimer] = SetTimerEx("UnMutePlayer", 180000, false, "i", pID), AccInfo[pID][Muted] = 1; format(sebStr, 369, "Administrator {FF0000}%s {00FF00}muted {00BBF6}%s {00FF00}(Reason: {00BBF6}%s{00FF00})", ReturnName(playerid), ReturnName(pID), params); //---------------------------------------------------------------------- return SendClientMessageToAll(LIME, sebStr); } else return SendClientMessage(playerid, RED, That player is not connected!"); }