02.11.2014, 09:23
I have a huge problem. I maked a clan sistem which allows players putting a tag infront of the name , e.g : [Oz]Paul , [Oz] = clan tag.
Now , the biggest problem is that 2 players can connect on the same account , one with the name Paul , and the second with the name [Oz]Paul and this is a huge bug. How to restrictionate this?
My enum clan's sistem:
Putting the tag
Now , the biggest problem is that 2 players can connect on the same account , one with the name Paul , and the second with the name [Oz]Paul and this is a huge bug. How to restrictionate this?
My enum clan's sistem:
pawn Код:
enum clanE
{
cClanName[64],
cClanMOTD[128],
cClanRankName1[32],
cClanRankName2[32],
cClanRankName3[32],
cClanRankName4[32],
cClanRankName5[32],
cClanRankName6[32],
cClanRankName7[32],
cClanTag[32],
cClanTagType,
}
pawn Код:
case 0:
{
format(string,256,"%s%s",clanVariables[playerVariables[playerid][pClan]][cClanTag],playerVariables[playerid][pNormalName]);
SetPlayerName(playerid, string);
format(string,256,"Nickname changed to: %s",string);
SCM(playerid,COLOR_WHITE,string);
}
case 1:
{
format(string,256,"%s%s",playerVariables[playerid][pNormalName],clanVariables[playerVariables[playerid][pClan]][cClanTag]);
SetPlayerName(playerid, string);
format(string,256,"Nickname changed to: %s",string);
SCM(playerid,COLOR_WHITE,string);
}
case 2:
{
format(string,256,"%s",playerVariables[playerid][pNormalName]);
SetPlayerName(playerid, string);
format(string,256,"Nickname changed to: %s",string);
SCM(playerid,COLOR_WHITE,string);
}
pawn Код:
if(playerVariables[extraid][pClan] >= 1)
{
if(playerVariables[extraid][pClanTagType] == 0)
{
format(string,256,"%s",playerVariables[extraid][pNormalName]);
SetPlayerName(extraid, string);
}
else if(playerVariables[extraid][pClanTagType] == 1)
{
format(string,256,"%s%s",clanVariables[playerVariables[extraid][pClan]][cClanTag],playerVariables[extraid][pNormalName]);
SetPlayerName(extraid, string);
}
else if(playerVariables[extraid][pClanTagType] == 2)
{
format(string,256,"%s%s",playerVariables[extraid][pNormalName],clanVariables[playerVariables[extraid][pClan]][cClanTag]);
SetPlayerName(extraid, string);
}
}