Admin Tags - 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: Admin Tags (
/showthread.php?tid=442448)
Admin Tags -
faff - 07.06.2013
pawn Код:
CMD:atag(playerid, params[])
{
new string[128];
new text;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You have to be OFF admin duty to use this command!");
if(sscanf(params, "s[24]", text)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /atag [admin tag]");
format(string, sizeof(string), "AdmWarn: %s has changed his admin tag to %s. ", RPN(playerid), text);
SendAdminMessage(COLOR_DARKRED, 1, string);
PlayerInfo[playerid][aMask] = text;
return 1;
}
Hello, I'm getting Problems..
Well, I want to save the TAG in ma' .ini files.
But the problem is, It's saving some random Characters.
Can somebody help me with it?
Re: Admin Tags -
faff - 07.06.2013
hmmm
Re: Admin Tags -
JamesS - 07.06.2013
Should be:
new text[24]; instead of new text; You are scanning a string into an integer ending up with having the ANSI code stored into the variable these are those random numbers.
Re: Admin Tags -
faff - 07.06.2013
Hmm.. Now it's just fixing the first String..
So, If ya' want your tag as, ''Faff'', it's only saving/showing ''F''
Edit; And i get this error.
pawn Код:
error 006: must be assigned to an array
The line:
pawn Код:
PlayerInfo[playerid][aMask] = text;
Re: Admin Tags -
gtakillerIV - 07.06.2013
What's aMask? Is it an integer or a string? If it's a string then you can either use
strcat to join the strings together or you can just format the string.
Re: Admin Tags -
Facerafter - 07.06.2013
I already fixed it for him @ skype, he wrote it as an integer instead of a string in his .ini