SA-MP Forums Archive
Admin tag - 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 tag (/showthread.php?tid=373893)



Admin tag - zacklogan - 01.09.2012

Ok im a newbie to scripting and i need a admin tag for SFCRRPG and I want it to say [ZL] in front of the admins name. Please Help!


Re: Admin tag - zacklogan - 24.09.2012

<deleted>


Re: Admin tag - zacklogan - 14.12.2012

<deleted>


Re: Admin tag - Mean - 14.12.2012

Use SetPlayerName().

pawn Код:
new oldname[MAX_PLAYER_NAME], newname[MAX_PLAYER_NAME];
GetPlayerName(playerid, oldname, sizeof oldname);
format(newname, sizeof newname, "[ZL]%s", oldname);
SetPlayerName(playerid, newname);



Re: Admin tag - zacklogan - 15.12.2012

Quote:
Originally Posted by Mean
Посмотреть сообщение
Use SetPlayerName().

pawn Код:
new oldname[MAX_PLAYER_NAME], newname[MAX_PLAYER_NAME];
GetPlayerName(playerid, oldname, sizeof oldname);
format(newname, sizeof newname, "[ZL]%s", oldname);
SetPlayerName(playerid, newname);
Where do i put it under?
Btw the admin code is if(AdminLevel[playerid] >= 1)


Re: Admin tag - Horrible - 15.12.2012

you can put it under your promote admin CMD.


Re: Admin tag - maramizo - 15.12.2012

Under the make admin command, you can place Mean's code.


Re: Admin tag - Mean - 15.12.2012

Post your setadmin cmd and maybe I (or someone else) will edit it for you.


Re: Admin tag - zacklogan - 15.12.2012

Quote:
Originally Posted by Mean
Посмотреть сообщение
Post your setadmin cmd and maybe I (or someone else) will edit it for you.
Код:
dcmd_adsetlevel(playerid,params[])
{
	new string[128];
	new ID;
	new cmdreason;
	if(sscanf(params,"ui",ID,cmdreason))
	{
	    SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adsetlevel (Player Name/ID) (Level)");
	    return 1;
	}
	if(!IsPlayerConnected(ID))
	{
	    format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot set their administrator level.",ID);
	    SendClientMessage(playerid,COLOR_ERROR,string);
	    return 1;
	}
	if(PLAYERLIST_authed[ID] != 1)
	{
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you set their administrator level.",PlayerName(ID),ID);
	    SendClientMessage(playerid,COLOR_ERROR,string);
	    return 1;
	}
	if(AdminLevel[ID] == cmdreason)
	{
	    format(string,sizeof(string),"%s(%d) is already at the Administrator level: %d",PlayerName(ID),ID,cmdreason);
	    SendClientMessage(playerid,COLOR_ERROR,string);
	    return 1;
	}
	if(playerid == ID)
	{
	    SendClientMessage(playerid,COLOR_ERROR,"You cannot set your own Administrator level. You are already the highest level.");
	    return 1;
	}
	format(string,sizeof(string),"[ADMIN LEVEL CHANGE] Owner %s(%d) has given %s(%d) the administrator level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
	SendClientMessageToAll(COLOR_ADMIN,string);
	
	SendClientMessage(ID,COLOR_ADMIN,"Your admin level has been changed by the Server Owner. To see your new commands type /adcmds.");
	AdminLevel[ID] =cmdreason;
	
	format(string,sizeof(string),"9[ADMIN LEVEL CHANGE] Owner %s(%d) has given %s(%d) the administrator level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
	IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
	return 1;
}



Re: Admin tag - Mean - 15.12.2012

pawn Код:
dcmd_adsetlevel(playerid,params[])
{
    new string[128];
    new ID;
    new cmdreason;
    if(sscanf(params,"ui",ID,cmdreason)) {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adsetlevel (Player Name/ID) (Level)");
        return 1;
    }
    if(!IsPlayerConnected(ID)) {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot set their administrator level.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(PLAYERLIST_authed[ID] != 1) {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you set their administrator level.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(AdminLevel[ID] == cmdreason) {
        format(string,sizeof(string),"%s(%d) is already at the Administrator level: %d",PlayerName(ID),ID,cmdreason);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(playerid == ID) {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot set your own Administrator level. You are already the highest level.");
        return 1;
    }
    format(string,sizeof(string),"[ADMIN LEVEL CHANGE] Owner %s(%d) has given %s(%d) the administrator level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
    SendClientMessageToAll(COLOR_ADMIN,string);
   
    SendClientMessage(ID,COLOR_ADMIN,"Your admin level has been changed by the Server Owner. To see your new commands type /adcmds.");
    AdminLevel[ID] =cmdreason;
   
    new oldname[MAX_PLAYER_NAME], newname[MAX_PLAYER_NAME];
    GetPlayerName(ID, oldname, sizeof oldname);
    format(newname, sizeof newname, "[ZL]%s", oldname);
    SetPlayerName(ID, newname);

    format(string,sizeof(string),"9[ADMIN LEVEL CHANGE] Owner %s(%d) has given %s(%d) the administrator level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}