Clan / Tag detection
Hey,
I was just feeling bored and thought of coding something. So, I scripted a clan detection script. Basically this is a clan detection script which detects the name tag when a player connects to the server. For example, if a player named '[YG]Simon' connects, it will detect that the player is using the server clan: i.e: '[YG]'.
This script is built in two callbacks which is for server clan and server official gang.
public OnPlayerConnectWithServerClanTag(playerid)
public OnPlayerConnectWithServerGangTag(playerid)
Example:
#define SERVER_CLAN "[Test]" //Defining a config and now the clan is set to '[Test]'.
public OnPlayerConnectWithServerClanTag(playerid)
{
SetTimerEx("DetectLogin", 60000, false, "d", playerid);
//Runs a timer to 1 minute.
return true;
}
#define Lpublic(%0) forward(%0);(public(%0))
Lpublic DetectLogin(playerid) //After the 1 min timer.
{
if(IsClanForPlayerActivated(playerid)) return 1; //If Clan var is activated it don't do anything.
else return Kick(playerid); //Else it will kick player.
return 1;
}
Code will be sent to YoUnG_MoNeY (Will forward within 5 mins, fixing bugs xD!)
Might be useful, i guess.