26.09.2011, 05:04
Ok, basically what i need is to make this command do more. Like for example if i demote, hire or fire someone, i want it to say in orange letters like: "Vincent_Johnson has promoted Drew_Anders to a level 1 Admin." "Vincent_Johnson has demoted Drew Anders to a level 1 Admin." or "Vincent_Johnson has removed Drew_Anders's Admin."
I'm having trouble making it do that exactly, like, i don't know what i'm supposed to do, if anyone could gimme some guidance, or simply tell me how to do it, that'd be so great.
I'm having trouble making it do that exactly, like, i don't know what i'm supposed to do, if anyone could gimme some guidance, or simply tell me how to do it, that'd be so great.
pawn Код:
if(strcmp(cmd,"/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-3)]");
return 1;
}
if(PlayerInfo[playerid][pDisabled] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't use this command ! You're Disabled !");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 9999)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), " You have been promoted to a level %d admin by %s.", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
ABroadCast(COLOR_SACBLUE,string, 2);
OnPlayerSave(playerid);
OnPlayerSave(para1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
}
return 1;
}