Clan tag problem -
bosmania - 04.03.2019
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);
}
}
}
Re: Clan tag problem -
hoanduy - 04.03.2019
Make sure that 'newname' does not exceed 'MAX_PLAYER_NAME'
MAX_PLAYER_NAME is 24
Re: Clan tag problem -
bosmania - 04.03.2019
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
Re: Clan tag problem -
TheToretto - 04.03.2019
How is "PlayerInfo[playerid][pClanTag]" declared in your enumerator?
Re: Clan tag problem -
bosmania - 04.03.2019
what do you mean by "how is declared"?
Re: Clan tag problem -
TheToretto - 04.03.2019
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 "[ ]")
Re: Clan tag problem -
bosmania - 04.03.2019
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
Re: Clan tag problem -
bosmania - 04.03.2019
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
Re: Clan tag problem -
bosmania - 04.03.2019
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
Re: Clan tag problem -
Private200 - 04.03.2019
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.