SA-MP Forums Archive
help me with this cmd - 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: help me with this cmd (/showthread.php?tid=640789)



help me with this cmd - GoldenMan - 07.09.2017

i created this /me command
PHP код:
CMD:me(playeridparams[])
{
    new 
tmp[256], playername[25];
    if (
sscanf(params"s[128]"tmp)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /me [message]");
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    for (new 
0PLAYERSi++)
    {
        if(
dini_Int(AddDirFile(dir_userfilesplayername), "RPName")==0)
        {
            if (
IsPlayerConnected2(i) && PlayerIgnored[i][playerid] == 0SendPlayerFormattedText(iCOLOR_GREEN"%s %s"playernametmp);
        }
        else
        {
            if (
IsPlayerConnected2(i) && PlayerIgnored[i][playerid] == 0SendPlayerFormattedText(iCOLOR_GREEN"%s %s"dini_Get(AddDirFile(dir_userfilesplayername), "RolePName"), tmp);
        }
    }
    
printf("[me] %s (Id%d) %s"playernameplayeridtmp);
    return 
1;

i want to add anti advert in this cmd if anyone type * GoldenMan server ip he get kicked

advanced thnx


Re: help me with this cmd - GoldenMan - 07.09.2017

pls help me


Re: help me with this cmd - n00blek - 07.09.2017

Try this and tel me if it works

PHP код:
CMD:me(playeridparams[]) 

    new 
tmp[256], playername[25]; 
    if (
sscanf(params"s[128]"tmp)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /me [message]"); 
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME); 
    for (new 
0PLAYERSi++) 
    { 
        if(
dini_Int(AddDirFile(dir_userfilesplayername), "RPName")==0
        { 
            if (
IsPlayerConnected2(i) && PlayerIgnored[i][playerid] == 0SendPlayerFormattedText(iCOLOR_GREEN"%s %s"playernametmp); 
        } 
        else 
        { 
            if (
IsPlayerConnected2(i) && PlayerIgnored[i][playerid] == 0SendPlayerFormattedText(iCOLOR_GREEN"%s %s"dini_Get(AddDirFile(dir_userfilesplayername), "RolePName"), tmp); 
        } 
    } 
    
printf("[me] %s (Id%d) %s"playernameplayeridtmp); 
    return 
1

public 
OnPlayerText(playeridtext[])
{
    if(
IsAdvertisement(text))
    {
        
SendClientMessage(playerid0xFFFFFFFF"{FF0000}[ERROR]: {FFFFFF}Your message contains an IP Address (strict detection).");
        return 
0;
    }
    return 
1;




Re: help me with this cmd - Meller - 07.09.2017

Quote:
Originally Posted by n00blek
Посмотреть сообщение
Try this and tel me if it works

PHP код:
CMD:me(playeridparams[]) 

    new 
tmp[256], playername[25]; 
    if (
sscanf(params"s[128]"tmp)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /me [message]"); 
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME); 
    for (new 
0PLAYERSi++) 
    { 
        if(
dini_Int(AddDirFile(dir_userfilesplayername), "RPName")==0
        { 
            if (
IsPlayerConnected2(i) && PlayerIgnored[i][playerid] == 0SendPlayerFormattedText(iCOLOR_GREEN"%s %s"playernametmp); 
        } 
        else 
        { 
            if (
IsPlayerConnected2(i) && PlayerIgnored[i][playerid] == 0SendPlayerFormattedText(iCOLOR_GREEN"%s %s"dini_Get(AddDirFile(dir_userfilesplayername), "RolePName"), tmp); 
        } 
    } 
    
printf("[me] %s (Id%d) %s"playernameplayeridtmp); 
    return 
1

public 
OnPlayerText(playeridtext[])
{
    if(
IsAdvertisement(text))
    {
        
SendClientMessage(playerid0xFFFFFFFF"{FF0000}[ERROR]: {FFFFFF}Your message contains an IP Address (strict detection).");
        return 
0;
    }
    return 
1;

tell me 1 reason this wouldn't return unknown native IsAdvertisement?