help /mute and /freeze not working :S
#1

Please ive tried everythinng and it still fails :S please someone look at my codes and tell me wat im doing wrong plz?

pawn Код:
CMD:freeze(playerid, params[])
{
    if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
    new target;
    new string[256], playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
    if(sscanf(params, "uc", playername, params)) return SendClientMessage(playerid,RED,"USAGE: /freeze [id] [reason]");
    target = MAX_PLAYER_NAME;
    if(IsPlayerConnected(target) && target != INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,">> Invalid Player ID!");
    GetPlayerName(target, playername, sizeof(playername));
    GetPlayerName(playerid, adminname, sizeof(adminname));
    TogglePlayerControllable(target,1);
    SendClientMessage(target,RED, ">> You Have Been Frozen By An Admin!");
    GameTextForPlayer(target,"~r~Frozen!",3000,5);
    format(string,sizeof(string),">> Administrator %s Has Frozen %s! Reason: %s",adminname,playername,string);
    return SendClientMessageToAll(RED,string);
}

CMD:unfreeze(playerid, params[])
{
    if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
    new target;
    new string[256], playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
    if(sscanf(params, "u", playername)) return SendClientMessage(playerid,RED,"USAGE: /unfreeze [id]");
    target = MAX_PLAYER_NAME;
    if(IsPlayerConnected(target) && target != INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,">> Invalid Player ID!");
    GetPlayerName(target, playername, sizeof(playername));
    GetPlayerName(playerid, adminname, sizeof(adminname));
    TogglePlayerControllable(target,1);
    SendClientMessage(target,YELLOW, ">> You Have Been Unfrozen By An Admin!");
    GameTextForPlayer(target,"~g~Unfrozen!",3000,5);
    format(string,sizeof(string),">> Administrator %s Has UnFrozen %s! Reason: %s",adminname,playername,string);
    return SendClientMessageToAll(RED,string);
}

CMD:mute(playerid, params[])
{
    if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
    new muteid;
    if(!strlen(params)) return SendClientMessage(playerid,RED,"USAGE: /mute [id]");
    {
        if (muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED, ">> Player Not Found!");
        {
            if(muteid == playerid) return SendClientMessage(playerid,RED, ">> You Cant Unmute Yourself!");
            {
                IsMuted[muteid] = 1;
                SendClientMessage(muteid,RED, ">> You Have Been Muted By An Admin!");
                GameTextForPlayer(muteid,"~r~Muted!",3000,5);
            }
        }
    }
    return true;
}

CMD:unmute(playerid, params[])
{
    if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
    new muteid;
    if(!strlen(params)) return SendClientMessage(playerid,RED,"USAGE: /unmute [id]");
    {
        if (muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED, ">> Player Not Found!");
        {
            if(muteid == playerid) return SendClientMessage(playerid,RED, ">> You Cant Unmute Yourself!");
            {
                IsMuted[muteid] = 0;
                SendClientMessage(muteid,YELLOW, ">> You Have Been Unmuted By An Admin!");
                GameTextForPlayer(muteid,"~g~Unmuted!",3000,5);
            }
        }
    }
    return true;
}
Reply
#2

Why playername in sscanf? and you trying to write player id..

Код:
new giveplayerid;
if(sscanf(cmdtext, "u", giveplayerid))
Reply
#3

EDIT
Reply
#4

Paste the errors here.
Reply
#5

pawn Код:
if(sscanf(params, "u", target))
Reply
#6

no errors.. i want a reason for /freeze id..plz help :S sscanf is tripping me right out :S
Reply
#7

pawn Код:
new reason[128];
if(sscanf(params, "us", target, reason))
Reply
#8

pawn Код:
CMD:freeze(playerid, params[])
{
    new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], reason[128], id;
    if (pInfo[playerid][Level] >= 3)
    {
        if (sscanf(params, "rs", id, reason)) return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /freeze [id] [reason]");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAY, "AdmCmd: This player is not connected.");
        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        new str[128];
        format(str,128,"AdmWarn: %s [ID %d] has frozen %s [ID %d] [Reason: %s]",adminname, playerid, victimname, id, reason);
        SendClientMessageToAll(RED,str);
        return TogglePlayerControllable(id,0);
    }
    else return SendClientMessage(playerid,COLOR_GRAY,"  You don't have authorization!");
}
Reply
#9

@Up
Let him think sometimes or he'll be never learn how to use that.
Reply
#10

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
@Up
Let him think sometimes or he'll be never learn how to use that.
Yes please explain to me wth im smoking cause im trippn man xD Just explain wat i did wrong and how u guys fixed it plz :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)