SA-MP Forums Archive
permission for tag REP+ - 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: permission for tag REP+ (/showthread.php?tid=593871)



permission for tag REP+ - Mijata - 10.11.2015

How to add when player enter server with [TVC]tag in name, if is his tag accepted he can enter game if is not he can't ??


Re: permission for tag REP+ - iGetty - 10.11.2015

Use strfind

https://sampwiki.blast.hk/wiki/Strfind

You can use MySQL or Dini or regular SA-MP file system to check to see if it's saved or not, tutorials all around.


Re: permission for tag REP+ - Twizted - 10.11.2015

Didn't compile or test, but you should be good. Credits to Sandra18[NL] for the PlayerNameContains function (see more).

pawn Код:
stock PlayerNameContains(playerid, const name[])
{
    if(IsPlayerConnected(playerid))
    {
        new PName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PName, sizeof(PName));
        for(new i=0; i<sizeof(PName); i++)
        {
            if(strfind(PName[i], name, true) != -1)
            {
                return 1;
            }
        }
    }
    else
    {
        return 0;
    }
    return 0;
}

OnPlayerConnect:
if(PlayerNameContains(playerid, "[TVC]")
{
    if(/*player is allowed to use the tag*/)
    {
        //whatever u want to do
    }
    else Kick(playerid);
    return 1;
}
    }



Re: permission for tag REP+ - Mijata - 11.11.2015

I need command to give permission for tag


Re: permission for tag REP+ - Mijata - 12.11.2015

bump


Re: permission for tag REP+ - iKarim - 12.11.2015

No one going to script a command for you literally, just do it yourself. Using any saving systems (MySQL, INI, SQLite)