SA-MP Forums Archive
/warn - 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: /warn (/showthread.php?tid=279946)



/warn - [HHT]DRON - 29.08.2011

But he did not kick a player for 3 warnings and the name of reason and nepishet how many warnings help please

Код:
{
        new target, reason[128], pName[MAX_PLAYER_NAME], gName[MAX_PLAYER_NAME], string[128];
        if (sscanf(params,"us[128]", target,reason)) return SendClientMessage(playerid,0xFF0000AA,"Используй: /warn [playerid] [Причина]");
        if(level[playerid] >= 1)
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        GetPlayerName(target, gName, MAX_PLAYER_NAME);
        SetPVarInt(target, "Warnings", GetPVarInt(target, "Warnings") + 1);
        if(GetPVarInt(target, "Warnings") == 3)
        {
            format(string, sizeof string, "{FF0A00}-[Администратор: %s]- {FFFFFF} автоматический кик %s за 3 предупреждения, последнее: %s", pName, gName, reason);
            SendClientMessageToAll(COLOR_YELLOW, string);
            SendClientMessage(target, COLOR_RED, "Ты был кикнут за 3 предупреждения!");
            format(string, sizeof string, "{FF0A00}-[Администратор: %s]- {FFFFFF} предупредил %s: %s [Кикнут]", pName, gName, reason);
            Kick(target);
        }
        else
        {
                format(string, sizeof string, "{FF0A00}-[Администратор: %s]- {FFFFFF} предупреждил %s причина: %s", pName, gName, reason);
                SendClientMessageToAll(COLOR_YELLOW,string);
                format(string, sizeof string, "{FF0A00}-[Администратор: %s]- {FFFFFF} предупредил игрока: %s [Предупреждений %d/3]", pName, reason, GetPVarInt(target, "Warnings"));
                SendClientMessage(target, COLOR_YELLOW, string);
                format(string, sizeof string, "{FF0A00}-[Администратор: %s]- {FFFFFF} предупреждения %s: %s [%i/3]", pName, gName, reason, GetPVarInt(target, "Warnings"));
        }
        return 1;
}



Re: /warn - =WoR=G4M3Ov3r - 29.08.2011

PHP код:
{
        new 
targetreason[128], pName[MAX_PLAYER_NAME], gName[MAX_PLAYER_NAME], string[128];
        if (
sscanf(params,"us[128]"target,reason)) return SendClientMessage(playerid,0xFF0000AA,"Eniieucoe: /warn [playerid] [I?e?eia]");
if(
IsPlayerConnected(giveplayerid))
{
        if(
level[playerid] >= 1)
        
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
        
GetPlayerName(targetgNameMAX_PLAYER_NAME);
        
SetPVarInt(target"Warnings"GetPVarInt(target"Warnings") + 1);
        if(
GetPVarInt(target"Warnings") == 3)
        {
            
format(stringsizeof string"{FF0A00}-[Aaieieno?aoi?: %s]- {FFFFFF} aaoiiaoe?aneee eee %s ca 3 i?aaoi?a?aaiey, iineaaiaa: %s"pNamegNamereason);
            
SendClientMessageToAll(COLOR_YELLOWstring);
            
SendClientMessage(targetCOLOR_RED"Ou aue eeeioo ca 3 i?aaoi?a?aaiey!");
            
format(stringsizeof string"{FF0A00}-[Aaieieno?aoi?: %s]- {FFFFFF} i?aaoi?aaee %s: %s [Eeeioo]"pNamegNamereason);
            
Kick(target);
        }
        else
        {
                
format(stringsizeof string"{FF0A00}-[Aaieieno?aoi?: %s]- {FFFFFF} i?aaoi?a?aee %s i?e?eia: %s"pNamegNamereason);
                
SendClientMessageToAll(COLOR_YELLOW,string);
                
format(stringsizeof string"{FF0A00}-[Aaieieno?aoi?: %s]- {FFFFFF} i?aaoi?aaee ea?iea: %s [I?aaoi?a?aaiee %d/3]"pNamereasonGetPVarInt(target"Warnings"));
                
SendClientMessage(targetCOLOR_YELLOWstring);
                
format(stringsizeof string"{FF0A00}-[Aaieieno?aoi?: %s]- {FFFFFF} i?aaoi?a?aaiey %s: %s [%i/3]"pNamegNamereasonGetPVarInt(target"Warnings"));
        }
        return 
1;