hellllppppp
#1

dcmd_freeze(playerid,params[])
{
if(Player[playerid][admin] < 1){
return SendClientMessage (playerid,COLOR_RED,"You must be a Mod/Admin to freeze Players");
}
new pID;
if(sscanf(params,"u",pID)){
return SendClientMessage(playerid,COLOR_RED,"USAGE: /freeze [playerid] [reason]");
}
if(!IsPlayerConnected(pID)){
return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
}
if(Player[playerid][admin] < Player[pID][admin]){
return SendClientMessage(playerid,COLOR_RED,"You can`t freeze a high ranked admin");
}
new string[128],adminname[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,adminname,sizeof(adminname) );
GetPlayerName(pID,name,sizeof(name));
format(string,sizeof(string),"**(Admin Freeze)** %s(%d) %s.",name,playerid);
SendClientMessageToAll(playerid,COLOR_RED,string);
TogglePlayerControllable(pID, 0);
return 1;
}


i want make akill like this format please help me guys and wanr and mute and unmute commands help me
Reply
#2

Isn't this easy? Just change text and delete TogglePlayerControllable and place SetPlayerHealth.
Reply
#3

pawn Код:
if(strcmp(cmd, "/akill", true) == 0)     {
    if(PlayerInfo[playerid][Level] >= 1) {
        new player1, tmp[256];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))    {
           SendClientMessage(playerid, red, "USAGE: /akill [playerid]");
        return 1;    }
        player1 = strval(tmp);

         if(IsPlayerConnected(player1))        {
            CMDMessageToAdmins(playerid,"AKILL");
            GetPlayerName(player1, playername, sizeof(playername));    GetPlayerName(playerid, adminname, sizeof(adminname));
            format(string,256,"Administrator %s has killed you",adminname);    SendClientMessage(player1,blue,string);
            format(string,256,"You have killed %s",playername); SendClientMessage(playerid,blue,string);
            SetPlayerHealth(player1,0.0);
               return 1;
        } else {
         SendClientMessage(playerid, red, "Player is not connected");
         return 1;    }
    } else     {
    SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
     return 1;    }
maybe u search his ?? o_0

here is the mute command:

pawn Код:
if(strcmp(cmd, "/mute", true) == 0)    {
    if(PlayerInfo[playerid][Level] >= 2) {
        new tmp[256];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))    {
        SendClientMessage(playerid, red, "USAGE: /mute [playerid] [reason]");
        return 1;    }
        new player1;
        player1 = strval(tmp);
        if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID || (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel]))    {
        SendClientMessage(playerid,red,"ERROR: Player is not connected or is yourself");
        return 1;    }
        tmp = strtok(cmdtext, idx);

        GetPlayerName(player1, playername, sizeof(playername));        GetPlayerName(playerid, adminname, sizeof(adminname));
        CMDMessageToAdmins(playerid,"MUTE");
        PlayerPlaySound(player1,1057,0.0,0.0,0.0);  PlayerInfo[player1][Muted] = 1; PlayerInfo[player1][MuteWarnings] = 0;
        format(string,256,"You have been muted by Administrator %s [reason: %s] ",adminname,cmdtext[8]);    SendClientMessage(player1,red,string);
        format(string,256,"You have muted %s [reason: %s] ",playername,cmdtext[8]);    SendClientMessage(playerid,blue,string);
    } else    {
      SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
    return 1;    }
and here is the unmute command:

pawn Код:
if(strcmp(cmd, "/unmute", true) == 0)    {
    if(PlayerInfo[playerid][Level] >= 2) {
        new tmp[256];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))    {
        SendClientMessage(playerid, red, "USAGE: /unmute [playerid] [reason]");
        return 1;    }
        new player1;
        player1 = strval(tmp);
        if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID )    {
        SendClientMessage(playerid,red,"ERROR: Player is not connected or is yourself");
        return 1;    }
        tmp = strtok(cmdtext, idx);

        GetPlayerName(player1, playername, sizeof(playername));        GetPlayerName(playerid, adminname, sizeof(adminname));
        CMDMessageToAdmins(playerid,"UNMUTE");
        PlayerPlaySound(player1,1057,0.0,0.0,0.0);  PlayerInfo[player1][Muted] = 0; PlayerInfo[player1][MuteWarnings] = 0;
        format(string,256,"You have been unmuted by Administrator %s",adminname);    SendClientMessage(player1,red,string);
        format(string,256,"You have unmuted %s",playername);    SendClientMessage(playerid,blue,string);
    } else    {
      SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
    return 1;    }
and here is the /warn command:

pawn Код:
if(strcmp(cmd, "/warn", true) == 0)    {
    if(PlayerInfo[playerid][Level] >= 2) {
    new tmp[256];    new str[256];    new pname[256];    new aname[256];    new tmp2[256];
    tmp = strtok(cmdtext, idx);
    tmp2 = strtok(cmdtext, idx);

    if(!strlen(tmp))    {
    SendClientMessage(playerid, red, "USAGE: /warn [PlayerID] [Reason]");
    return 1;    }
   
    new warned;
    warned = strval(tmp);
    if(!IsPlayerConnected(warned) || warned == INVALID_PLAYER_ID || (PlayerInfo[warned][Level] == ServerInfo[MaxAdminLevel]) || (warned == playerid))    {
    SendClientMessage(playerid,red,"ERROR: Player is not connected or is yourself");
    return 1;    }
    tmp = strtok(cmdtext, idx);

    CMDMessageToAdmins(playerid,"WARN");
    if(PlayerInfo[warned][Warnings] == 0)    {
        PlayerInfo[warned][Warnings]+=1;
        GetPlayerName(warned, pname, sizeof (str));        GetPlayerName(playerid, aname, sizeof (str));
        format(str, sizeof (str), "***Administrator %s has given %s a warning [Reason: %s] [1/3 Warnings]***", aname, pname, cmdtext[8]);
        SendClientMessageToAll(yellow, str);
        return 1;    }
    else if(PlayerInfo[warned][Warnings] == 1)    {
        GetPlayerName(warned, pname, sizeof (str));        GetPlayerName(playerid, aname, sizeof (str));
        format(str, sizeof (str), "***Administrator %s has given %s a warning [Reason: %s] [2/3 Warnings]***", aname, pname, cmdtext[8]);
        SendClientMessageToAll(yellow, str);
        PlayerInfo[warned][Warnings]+=1;
        return 1;    }
    else if(PlayerInfo[warned][Warnings] == 2)    {
        GetPlayerName(warned, pname, sizeof (str));        GetPlayerName(playerid, aname, sizeof (str));
        format(str, sizeof (str), "***Administrator %s has Kicked %s [Reason: %s] [3/3 Warnings]***", aname, pname, cmdtext[8]);
        SendClientMessageToAll(grey, str);
        SaveToFile("KickLog",str);    Kick(warned);
        return 1;    }
    } else    {
     SendClientMessage(playerid,red,"ERROR: You need to be level 2 to use this command");   }
    return 1;    }
there u are fell free to change the words if u want and if u need help more just send me PM am alwaus happly to help some one !

Good LUCK !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)