Clan tag problem
#1

When im using the option to put my clan tag on it just shows empty brackets like this and the name [].Name
this is my function for the clan tag set.I tried to use it as a stock function but still not working

function SetTag (playerid)
{
new name [ MAX_PLAYER_NAME ];
new newname [ 30 ];

GetPlayerName ( playerid , name , sizeof(name));

format ( newname , sizeof ( newname ) , "[%s].%s", PlayerInfo[playerid][pClanTag], name);

SetPlayerName ( playerid , newname );

return 1;
}

and here the player gets or should get the tag
case DIALOG_ADTAG:
{
if(!response) return 1;
switch(listitem)
{
case 0:
{
SetTag(playerid);

}
}
}
Reply
#2

Make sure that 'newname' does not exceed 'MAX_PLAYER_NAME'
MAX_PLAYER_NAME is 24
Reply
#3

New problem,now it works,i've solved that problem, but it shows only the first letter from the tag,for example if the tag is "test" it show the name like this: [t].Name
Reply
#4

How is "PlayerInfo[playerid][pClanTag]" declared in your enumerator?
Reply
#5

what do you mean by "how is declared"?
Reply
#6

Check out your enum for PlayerInfo, it could be something like "enum E_PLAYER_INFO" or anything, then look for the line which contains "pClanTag" and drop it down here please.

(To help you find the enum, CTRL + F => new PlayerInfo[MAX_PLAYERS][/something.will.be.here] then copy the content of the "[ ]")
Reply
#7

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Check out your enum for PlayerInfo, it could be something like "enum E_PLAYER_INFO" or anything, then look for the line which contains "pClanTag" and drop it down here please.

(To help you find the enum, CTRL + F => new PlayerInfo[MAX_PLAYERS][/something.will.be.here] then copy the content of the "[ ]")
// Player Info
enum pInfo {
pID, pUsername[MAX_PLAYER_NAME],
pPass, pStatus,
pLevel, pRespect,
pAdmin, pHelper,
pMoney, pBankMoney,
pHouseKey, pBusinessKey,
pRentedHouse, pFaction,
pMember, pLeader,
pRank, pFactionPunish,
pSex, pAge,
pMuted, pMuteTime,
pJailed, pJailTime,
pWantedLevel, pWantedReason[256],
pWantedTime,
pEmail[64], pSkin,
pContract, pContractValue,
pAcceptedContract,
pLanguage, pBanned,
pCarLicence, pFlyLicence,
pBoatLicence, pBikeLicence,
pGunLicence, pPremiumPoints,
pPremiumAcount, pWalkie,
pWalkieOn, pNumber,
pCellphone, pCellphoneOnline,
pPermGun, pPhoneCredit,
pClanMember, pClanRank,
pClanInvite, pClanid,
pIphone, pLastMessage,
pClanTag, pClanTagOn
}
new PlayerInfo[MAX_PLAYERS][pInfo];
this is the whole enum,pClanTag is the last on the left row,now other things i have on clan tag

its defined for updating in the data base, #define pClanTagx 50,
the case with the clan tag in my UpdateVariable(playerid, varid) function,

case pClanTagx: format(query, sizeof(query), "UPDATE `users` SET `ClanTag` = '%s' WHERE `ID` = '%d'", PlayerInfo[playerid][pClanTag], PlayerInfo[playerid][pID]);

and this
cache_get_field_content(0, "ClanTag", sz); format(PlayerInfo[playerid][pClanTag], 5, sz);

but i don't think the problem comes from any of this
Reply
#8

if(PlayerInfo[playerid][pClanTagOn] == 0)
{
PlayerInfo[playerid][pClanTagOn] = 1;
SetTag(playerid, PlayerInfo[playerid][pClanTag]);
SendClientMessage(playerid, -1, "Clan tag:On");
UpdateVariable(playerid, pClanTagOnx);
}
else
{
PlayerInfo[playerid][pClanTagOn] = 0;
// here should be something for instantly removing the tag when the clan tag is off,i dont know how to do that.
SendClientMessage(playerid, -1, "Clan tag:Off");
UpdateVariable(playerid, pClanTagOnx);
}


if(PlayerInfo[playerid][pClanTagOn] == 1)
{
SetTag(playerid, PlayerInfo[playerid][pClanTag]);
}
this is under OnPlayerSpawn callback btw

this is how im checking if the player has the clan tag on,i have the "pClanTagOn" defined and all,but it still doesnt work,when im reconnecting on the server i don't have the tag,i have to put it again,and yes,pClanTagOn has value "1" in the database when im spawning and still does't show my tag only after i activate it again

It would mean a lot if you help me solve this,so please help both with the tag saving after relog and with the tag showing like this [OnlyTheFirstLetterFromTheTag].Name
Reply
#9

function SetTag (playerid, tag)
{
new name [ MAX_PLAYER_NAME ];
new newname [MAX_PLAYER_NAME];

GetPlayerName ( playerid , name , sizeof(name));

format ( newname , sizeof ( newname ) , "[%s].%s", tag, name);

SetPlayerName ( playerid , newname );

return 1;
}

this is the settag function
Reply
#10

I am assuming that you have not scripted this function/script you are using. Make sure you have set your clan tag to a value. Your tag seems to be null/empty string at the moment (you can verify it by printing the tag and checking your console).

Your problem is either with loading your tag, or setting it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)