01.09.2012, 01:10
(
Последний раз редактировалось zacklogan; 14.12.2012 в 22:47.
)
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!
new oldname[MAX_PLAYER_NAME], newname[MAX_PLAYER_NAME];
GetPlayerName(playerid, oldname, sizeof oldname);
format(newname, sizeof newname, "[ZL]%s", oldname);
SetPlayerName(playerid, newname);
Use SetPlayerName().
pawn Код:
|
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; }
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;
}