/dnd & /dndall cmd :P Help :D
#1

Deleted.
Reply
#2

Create the cmd /dnd to store into a variable of the player that uses the cmd the id of the person that can't pm him.

Like in the enum put one like this DND[MAX_PLAYERS],

Then the player id uses, let's imagine, /dnd 2 So the variable DND[2] would be set to 1 while all others are 0. Then in the pm cmd make it to check if that variable is 1 or 0. If it's 1 then make him not able to send pm, else send.

Hope understood that. There may be easier ways, but that's the only I cna think of right now. BTW for the dndall make it to set 1 to every single id with a loop.
Reply
#3

do you mean this

pawn Код:
CMD:pm(playerid,params[]) {
    new id, gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME];
    if (sscanf(params, "is",id,gMessage)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /pm <ID> <Message>");
    if(!IsPlayerConnected(id)) {
        SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
        return 1;
    }
    if(playerid == id) {
        SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
        return 1;
    }
    if(ServerInfo[ReadPMs] == 1 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
    {
        new string[128],recievername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, string, sizeof(string)); GetPlayerName(id, recievername, sizeof(recievername));
        format(string, sizeof(string), "***PM: %s To %s: %s", string, recievername, gMessage);
        for (new a = 0; a < MAX_PLAYERS; a++) if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && a != playerid)
        SendClientMessage(a, grey, string);
    }
    if(PlayerInfo[playerid][Muted] == 1)
    {
        new string[128];
        PlayerInfo[playerid][MuteWarnings]++;
        if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
            format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
            SendClientMessage(playerid,red,string);
        } else {
            SendClientMessage(playerid,red,"You have been warned! Now you have been kicked");
            GetPlayerName(playerid, string, sizeof(string));
            format(string, sizeof(string),"%s [ID %d] Kicked for exceeding mute warnings", string, playerid);
            SendClientMessageToAll(grey,string);
            SaveToFile("KickLog",string); Kick(playerid);
        }
        return 0;
    }
Reply
#4

Deleted.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)