05.04.2013, 17:30
I need help with my /setadmin command. So it's working with this code:
Ok, so I want it to say:
"[AdmCmd] %s %s(ID:%d) had made %s(ID:%d) a %s"
I want the %s's and the %d's to be:
Rank of person who typed the command
Person who typed the command's name
Person who typed the command's ID.
Person who's ID was typed's name
Person who's ID was typed's ID
Rank they have become.
So, for example:
"[AdmCmd] Community Owner Joe_Maclesfield(ID:0) has made Alfie_Lester(ID:1) a Moderator!"
Ok, so I would not have a problem apart from the fact that a level 1 administrator is a moderator, so it would say:
"[AdmCmd] 5 Joe_Maclesfield(ID:%d) has made Alfie_Lester(ID:%d) a 1!"
instead of:
"[AdmCmd] Community Owner Joe_Maclesfield(ID:%d) has made Alfie_Lester(ID:%d) a Moderator!"
Sorry, I know that this question is incorrectly worded. I'm having trouble explaining it.
So, how would I define:
1 as Moderator
2 as Trial Administrator
3 as Administrator
4 as Lead Administrator
5 as Community Owner.
to make it say Community Owner instead of 5 in this one command.
If you cannot understand what I mean or need me to reword it all, just ask please.
Thanks a lot,
anjh.
pawn Код:
CMD:setadmin(playerid, params[])
{
new id, adminlevel;
if(PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessage(playerid, COLOR_SILVER, "You must be atleast a Community Owner to use this command!");
else if(sscanf(params, "ud", id, adminlevel)) return SendClientMessage(playerid, COLOR_SILVER, "Syntax: /setadmin [PlayerID][Admin Level]");
else if(adminlevel < 0 || adminlevel > 5) return SendClientMessage(playerid, COLOR_SILVER, "Error: Must be level 1-5!");
else
{
if(PlayerInfo[id][pAdmin] == adminlevel) return SendClientMessage(playerid, COLOR_SILVER, "Error: This player is already that level!");
else
{
PlayerInfo[id][pAdmin] = adminlevel;
}
}
return 1;
}
"[AdmCmd] %s %s(ID:%d) had made %s(ID:%d) a %s"
I want the %s's and the %d's to be:
Rank of person who typed the command
Person who typed the command's name
Person who typed the command's ID.
Person who's ID was typed's name
Person who's ID was typed's ID
Rank they have become.
So, for example:
"[AdmCmd] Community Owner Joe_Maclesfield(ID:0) has made Alfie_Lester(ID:1) a Moderator!"
Ok, so I would not have a problem apart from the fact that a level 1 administrator is a moderator, so it would say:
"[AdmCmd] 5 Joe_Maclesfield(ID:%d) has made Alfie_Lester(ID:%d) a 1!"
instead of:
"[AdmCmd] Community Owner Joe_Maclesfield(ID:%d) has made Alfie_Lester(ID:%d) a Moderator!"
Sorry, I know that this question is incorrectly worded. I'm having trouble explaining it.
So, how would I define:
1 as Moderator
2 as Trial Administrator
3 as Administrator
4 as Lead Administrator
5 as Community Owner.
to make it say Community Owner instead of 5 in this one command.
If you cannot understand what I mean or need me to reword it all, just ask please.
Thanks a lot,
anjh.