#23

Quote:
Originally Posted by BigETI
View Post
I doubt you actually test and revise your code before publishing it.
I do. What's wrong with those two codes? Bascially if someone says "rcon" he'll get warned. But wait, just one word is sufficient, sorry. "rcon" is the same as "/rcon" so no need to add more words. So it'll give:

PHP Code:
public OnPlayerText(playeridtext[]) 
{
    if(
strfind(text"rcon"true) != -1)
    {
        
SendClientMessage(playerid, -1"Bad idea.");
        
// Ban him if you want to :)
        
return 0;
    }
    return 
1;

Then, this one's all right huh?

PHP Code:
public OnRconLoginAttempt(ip[], password[], success

    if(!
success
    { 
        new 
IPAddr[16], str[64]; 
        static 
r_Warnings[MAX_PLAYERS]; 
        for(new 
iMAX_PLAYERSi++) 
        { 
            if(!
IsPlayerConnected(i)) continue; 
            
GetPlayerIp(iIPAddrsizeof(IPAddr)); 
            if(!
strcmp(ipIPAddrfalse)) 
            { 
                if(
r_Warnings[i] < 2)  
                { 
                    
r_Warnings[i]++; 
                    
format(strsizeof(str), "Warnings: (%i / 3)"r_Warnings[i]); 
                    return 
SendClientMessage(i, -1str); 
                } 
                else 
                { 
                    
Kick/*Ex*/(i); // Delay the ban with a timer so the playerid receives the message before getting banned 
                    
return SendClientMessage(i, -1"You've been warned."); 
                } 
            } 
        } 
    } 
    return 
1

Reply


Messages In This Thread
RCON - by Hunud - 28.10.2018, 12:51
Re: RCON - by v1k1nG - 28.10.2018, 14:16
Re: RCON - by Calisthenics - 28.10.2018, 14:39
Re: RCON - by RogueDrifter - 28.10.2018, 14:52
Re: RCON - by v1k1nG - 28.10.2018, 15:12
Re: RCON - by d3Pedro - 28.10.2018, 17:44
Re: RCON - by Calisthenics - 28.10.2018, 17:46
Re: RCON - by v1k1nG - 28.10.2018, 18:52
Re: RCON - by TheToretto - 28.10.2018, 21:32
Re: RCON - by RogueDrifter - 28.10.2018, 22:13
Re: RCON - by TheToretto - 28.10.2018, 22:19
Re: RCON - by RogueDrifter - 28.10.2018, 22:21
Re: RCON - by TheToretto - 28.10.2018, 22:38
Re: RCON - by RogueDrifter - 28.10.2018, 22:42
Re: RCON - by TheToretto - 28.10.2018, 22:45
Re: RCON - by RogueDrifter - 28.10.2018, 22:55
Re: RCON - by TheToretto - 28.10.2018, 22:59
Re: RCON - by RogueDrifter - 28.10.2018, 23:05
Re: RCON - by Jefff - 28.10.2018, 23:18
Re: RCON - by TheToretto - 29.10.2018, 06:58
Re: RCON - by TheToretto - 29.10.2018, 08:58
Re: RCON - by BigETI - 29.10.2018, 10:07
Re: RCON - by TheToretto - 29.10.2018, 10:19
Re: RCON - by TheToretto - 29.10.2018, 13:40
Re: RCON - by OiLoL - 29.10.2018, 15:37
Re: RCON - by v1k1nG - 29.10.2018, 15:50
Re: RCON - by GangstaSunny. - 29.10.2018, 23:02
Re: RCON - by Hunud - 30.10.2018, 12:51
Re: RCON - by NaS - 30.10.2018, 14:08
Re: RCON - by v1k1nG - 30.10.2018, 15:57

Forum Jump:


Users browsing this thread: 3 Guest(s)