Clan Tag Checker - 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: Clan Tag Checker (
/showthread.php?tid=568494)
Clan Tag Checker -
Rockyyy - 22.03.2015
Hey, im trying to create tag for my server and #ONLY_ADMINS can join with it but it let anyone joins, here is the code
that code under onplayerconnect and after logging in
pawn Код:
if(strfind(name,"[EXP]",true) != -1)
{
if(PlayerInfo[playerid][Level] >= 2)
{
format(string9, sizeof(string9), "%s {%d} has been kicked for having [EXP] clan-tag in their name.", name, playerid);
SendClientMessageToAll(COLOR_ORANGE, string9);
return 1;
}
}
Re: Clan Tag Checker -
Misiur - 22.03.2015
Well, you forgot the actual kick command!
Re: Clan Tag Checker -
Rockyyy - 22.03.2015
im using it on gm but forgot to post it here my mistake,
Re: Clan Tag Checker -
Pottus - 22.03.2015
If you don't need much just make a list of protected tags then check them against the players name using strfind
https://sampwiki.blast.hk/wiki/Strfind .
If you need a whole new system based on tags it would be more work.
Re: Clan Tag Checker -
Rockyyy - 26.03.2015
bump
Re: Clan Tag Checker -
SickAttack - 26.03.2015
Something like this:
pawn Код:
if(strfind(name, "[EXP]", true) != -1)
{
if(PlayerInfo[playerid][Level] == 0)
{
format(string9, sizeof(string9), "%s {%d} has been kicked for having [EXP] clan-tag in their name.", name, playerid);
SendClientMessageToAll(COLOR_ORANGE, string9);
KickPlayer(playerid);
}
}
stock KickPlayer(playerid) return SetTimerEx("KickPlayerEx", 100, false, "i", playerid);
function KickPlayerEx(playerid) return Kick(playerid);
Re: Clan Tag Checker -
CalvinC - 26.03.2015
You're checking i the player's admin level is higher or equal to 2, so admins cannot join with that tag.
You should use
pawn Код:
if(PlayerInfo[playerid][Level] < 2)
Re: Clan Tag Checker -
Rockyyy - 03.04.2015
Admins and everyone else can join with tag i don't know whats wrong
Re: Clan Tag Checker -
CalvinC - 04.04.2015
Your script should look somewhat like this:
Код:
KickEx(playerid) SetTimerEx("KickTimer", 100, false, "i", playerid);
public OnPlayerConnect(playerid)
{
new
name[21],
string9[44 + 21]
;
GetPlayerName(playerid, name, sizeof(name));
if(strfind(name, "[EXP]", true) != -1)
{
if(PlayerInfo[playerid][Level] < 2)
{
format(string9, sizeof(string9), "%s {%d} has been kicked for having [EXP] clan-tag in their name.", name, playerid);
SendClientMessageToAll(COLOR_ORANGE, string9);
KickEx(playerid);
}
}
return 1;
}
forward KickTimer(playerid);
public KickTimer(playerid) Kick(playerid);
That should work.
Re: Clan Tag Checker -
VishvaJeet - 04.04.2015
Код:
public OnPlayerConnect(playerid)
{
new name[24]; GetPlayerName(playerid, name, 24);
if(strfind(name, "[EXP]", true) != -1) // check clan in player's name
{
if(PlayerInfo[playerid][AdminLevel] == 0) // check is player admin ? if not then kick
{
new kickmsg[256];
format(kickmsg, sizeof(kickmsg), "%s [%d] has been kicked for having [EXP] clan-tag in their name.", name, playerid);
SendClientMessageToAll(COLOR_ORANGE, kickmsg);
SetTimerEx("ServerKick",500,0,"i",playerid);
}
}
}
forward ServerKick(playerid);
public ServerKick(playerid)
{
Kick(playerid);
}
This code will work