Scripting Help
#1

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.


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

Uh, just set his admin level to 0 then it's over lol.
Reply
#3

Have like:

pawn Код:
if(PlayerInfo[para1][pAdmin] < level)
{
    format(string, sizeof(string), "   You have been demoted to a level %d admin by %s.", level, sendername);
}
if(PlayerInfo[para1][pAdmin] > level)
{
    format(string, sizeof(string), "   You have been promoted to a level %d admin by %s.", level, sendername);
}
if(PlayerInfo[para1][pAdmin] == 0)
{
    format(string, sizeof(string), "   Your admin rights have been removed by %s.", level, sendername);
}
//Send the string here
If you get my drift. I don't know if I done the maths right? But you should know what I mean...
Reply
#4

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Have like:

pawn Код:
if(PlayerInfo[para1][pAdmin] < level)
{
    format(string, sizeof(string), "   You have been demoted to a level %d admin by %s.", level, sendername);
}
if(PlayerInfo[para1][pAdmin] > level)
{
    format(string, sizeof(string), "   You have been promoted to a level %d admin by %s.", level, sendername);
}
if(PlayerInfo[para1][pAdmin] == 0)
{
    format(string, sizeof(string), "   Your admin rights have been removed by %s.", level, sendername);
}
//Send the string here
If you get my drift. I don't know if I done the maths right? But you should know what I mean...
Yeah your 'maths' if we can even call it that is a bit off. The players current level is stored in the variable pAdmin, therefore if pAdmin is greater than level, it means the admin is being demoted.
Reply
#5

Quote:
Originally Posted by Ensconce
Посмотреть сообщение
Yeah your 'maths' if we can even call it that is a bit off. The players current level is stored in the variable pAdmin, therefore if pAdmin is greater than level, it means the admin is being demoted.
Well would you happen to know how to do it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)