Admin tag
#1

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!
Reply
#2

<deleted>
Reply
#3

<deleted>
Reply
#4

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);
Reply
#5

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)
Reply
#6

you can put it under your promote admin CMD.
Reply
#7

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

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

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;
}
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)