Warn System
#7

Quote:
Originally Posted by XBrianX
Посмотреть сообщение
If you mean warn like this.



PHP код:
CMD:warn(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
        
        new 
string[128], giveplayeridreason[64];
        if(
sscanf(params"us[64]"giveplayeridreason)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /warn [playerid/partofname] [reason]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pAdmin] >= 1)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Admins can't be warned!");
                return 
1;
            }
            
PlayerInfo[giveplayerid][pWarns] += 1;
            if(
PlayerInfo[giveplayerid][pWarns] >= 3)
            {
                new 
ip[32];
                
GetPlayerIp(giveplayerid,ip,sizeof(ip));
                
format(stringsizeof(string), "AdmCmd: %s (IP: %s) was banned by %s (had 3 Warnings), reason: %s"GetPlayerNameEx(giveplayerid), ipGetPlayerNameEx(playerid), reason);
                
Log("logs/ban.log"string);
                
format(stringsizeof(string), "AdmCmd: %s was banned by %s (had 3 Warnings), reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                
ABroadCast(COLOR_LIGHTREDstring5);
                
PlayerInfo[giveplayerid][pBanned] = 1;
                
AddBan(ip);
                
Kick(giveplayerid);
                return 
1;
            }
            
format(stringsizeof(string), "AdmCmd: %s was warned by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
            
ABroadCast(COLOR_LIGHTREDstring1);
            
format(stringsizeof(string), "AdmCmd: %s was warned by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
            
Log("logs/admin.log"string);
            
format(stringsizeof(string), "You were warned by %s, reason: %s"GetPlayerNameEx(playerid), reason);
            
SendClientMessage(giveplayeridCOLOR_LIGHTREDstring);
            return 
1;
        }
    }
    else 
SendClientMessage(playeridCOLOR_GRAD1"You're not authorized to use that command!");
    return 
1;

Stop copying your scripts dude, he would never learn something.
For creating a warn system, just make a variable. If the variable equal 1, the player's getting the warn, if it's 0, he doesn't.
Reply


Messages In This Thread
Warn System - by Trollerz - 14.09.2015, 14:50
Re: Warn System - by Sithis - 14.09.2015, 14:59
Re: Warn System - by ahameed4755 - 14.09.2015, 15:27
Re: Warn System - by Trollerz - 14.09.2015, 16:56
Re: Warn System - by XBrianX - 14.09.2015, 17:01
Re: Warn System - by saffierr - 14.09.2015, 21:15
Re : Re: Warn System - by KillerDVX - 14.09.2015, 22:52
Re: Re : Re: Warn System - by XBrianX - 15.09.2015, 11:05
Re: Warn System - by saffierr - 15.09.2015, 14:58

Forum Jump:


Users browsing this thread: 1 Guest(s)