SA-MP Forums Archive
Kick Command Bugs. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kick Command Bugs. (/showthread.php?tid=651694)



Kick Command Bugs. - Lixyde - 25.03.2018

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!


Re: Kick Command Bugs. - MadeMan - 25.03.2018

What is targetid ?


Re: Kick Command Bugs. - Lixyde - 25.03.2018

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!


Re: Kick Command Bugs. - FuNkYTheGreat - 25.03.2018

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!


Re: Kick Command Bugs. - Lixyde - 25.03.2018

Thanks! It works!