TAGCLAN
#1

Hi guys, I have this clan name script but, i want to make it many names not only 1!

Код:
#define TAGCLAN "[TGT]" // example [TGT]
But i want to make something like not only [TGT] name but ]TGT[ , (TGT) , )TGT( , and etc...
Reply
#2

pawn Код:
#define TAGCLAN_TGT "[TGT]"
#define TAGCLAN_CC   "[CC]"
#define TAGCLAN_NBK  "[NBK]"
Reply
#3

But i dont want to change the #define name...
Reply
#4

Any help?
Reply
#5

pawn Код:
#define TAGNAME "TGT"
// code
format(SomeString, sizeof(SomeString), "]%s[", TAGNAME);
Reply
#6

Check in filterscripts section, I saw a filterscript for this Im sure.
Reply
#7

Why not make the clan tag a variable?
pawn Код:
new clanTag[MAX_PLAYERS][8]; // Will store the players' clan tag.

CMD:clantag(playerid, params[]) // The command to let the player set his own clan tag name, could be extended upon by letting only admins set it, or whatever you want really.
{
  new pName[MAX_PLAYER_NAME + 1];
  format(clanTag[playerid], 8, "%s", params); // Format the variable using the users' input.
  GetPlayerName(playerid, pName, MAX_PLAYER_NAME); // Get the players' name
  if ( strlen(pName) + strlen(clanTag[playerid]) <= MAX_PLAYER_NAME ) // Check if the size doesn't exeed the maximum player name
  {
    format(pName, sizeof(pName), "%s%s", clanTag[playerid], pName);
    SetPlayerName(playerid, pName); // Give the player a new name using his clan tag.
  }
  return 1;
}
I haven't tested it, but I'm almost positive it'll work, in either case, it'll give a good example on how you could do this instead.
Reply
#8

I'd drop the define and use a const variable

Код:
stock const ClanTag[][] = {
    { "[TGT]" },
    { "]TGT[" },
    { "(TGT)" },
    { ")TGT(" }
};

stock CheckTag(Tag[])
{
     for(new i = 0; i < sizeof(ClanTag), i++) { if(!strcmp(ClanTag[i], Tag)) return 1; }
     return 0;
}
Then just use ..... if(CheckTag("[uL]"))
Reply
#9

Guys, Its [TGT] but i want to make it to ]TGT[ + [TGT] + (TGT) + )TGT(. All this not only 1
Reply
#10

pawn Код:
#define TAGCLAN "[TGT] ]TGT[ (TGT) )TGT("
Won't look good though
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)