Kick Command Bugs.
#1

I Use this: https://sampforum.blast.hk/showthread.php?tid=540392
with a little edit and there is a problem...


Код:
stock MutePlayer(playerid, iGivedBy, iTime, szReason[])
{
        if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Този играч не е в сървъра!");
        UTS_MuteTime[playerid] = gettime() + 60 * iTime;
        format(szReasonMute[playerid], 32, szReason);
        new szName[MAX_PLAYER_NAME], szString[168];
        new targetid;
        new TargetName[MAX_PLAYER_NAME];
        GetPlayerName(targetid, TargetName, sizeof(TargetName));
        GetPlayerName(iGivedBy, szName, MAX_PLAYER_NAME);
        format(szString, sizeof(szString), "{FF1E00}%s е заглушен от администратор %s за %d минута/и. [Причина: %s]", TargetName, szName, iTime, szReason);
        SendClientMessageToAll(-1, szString);
        return 1;
}
(Ignore the bugged text)

Now the problem is that when i type to mute other player it says <MYNAME> is muted by <MYNAME>

Where is the problem?? I don't know please help!

Also there is bug #2. When i mute myself it says "xtest is muted by administrator <MYNAME>" xtest?? WHAT?
When i type other reason the place where it needs to be the name of the target it says the reason with "x".
Like when i mute myself and type for reason: test the target name its "xtest" when i type example its "xexample"

But this bug doesn't appear when i mute other players. It says my name is muted by my name, when i mute other players.

How to fix those 2 bugs? Please help!
Reply
#2

What is targetid ?
Reply
#3

I Added it, because i think that it would work like that:

new targetid;
new TargetName[MAX_PLAYER_NAME].

And then GetPlayerName function and all of this.
But i know that this is wrong. Can you fix the command or tell me what i should put in the bugged thing.
Please help!
Reply
#4

NVM Identified it from the topic..

Код:
MutePlayer(playerid, iGivedBy, iTime, szReason[])
{
        if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Този играч не е в сървъра!");
        UTS_MuteTime[playerid] = gettime() + 60 * iTime;
        format(szReasonMute[playerid], 32, szReason);
        new szName[MAX_PLAYER_NAME], szString[168];
        new TargetName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, TargetName, sizeof(TargetName));
        GetPlayerName(iGivedBy, szName, MAX_PLAYER_NAME);
        format(szString, sizeof(szString), "{FF1E00}%s е заглушен от администратор %s за %d минута/и. [Причина: %s]", TargetName, szName, iTime, szReason);
        SendClientMessageToAll(-1, szString);
        return 1;
}
Use this one!
Reply
#5

Thanks! It works!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)