need help with /makeadmin cmd
#1

when i try to use /makeadmin command on my server it doesnt do anything...look at this pawno script
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 9999
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strvalEx(tmp);
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);
}
}
}
}
return 1;
}
Reply
#2

use [ pawn ] & [ /pawn ] without spaces to make it more clear.
Quote:
Originally Posted by Nuff
Nuff Said
Reply
#3

pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 99998)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level]");
                    return 1;
                }
                new para1;
                new level;
                para1 = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                level = strvalEx(tmp);
                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);
                    }
                }
            }
        }
        return 1;
    }
help me with this i dont know how!!!!!!!!!!1
Reply
#4

Quote:
Originally Posted by PheonixButcher
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 99998)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level]");
                    return 1;
                }
                new para1;
                new level;
                para1 = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                level = strvalEx(tmp);
                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);
                    }
                }
            }
        }
        return 1;
    }
help me with this i dont know how!!!!!!!!!!1
hey can anyone help mee!!!!!!! plzz answer!!
Reply
#5

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]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 10)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GiveNameSpace(sendername);
                        GiveNameSpace(giveplayer);
                        if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
                        new Float:shealth;
                        GetPlayerHealth(para1,shealth);
                        SetPlayerHealthEx(para1,shealth);
                        new Float:darmour;
                        GetPlayerArmour(para1,darmour);
                        SetPlayerArmourEx(para1,darmour);
                        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_WHITE, string);
                        format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "[ID: %d]  %s has promoted %s [ID: %d] to a level %d admin.", playerid, sendername, giveplayer, para1,level);
                        ABroadCast(COLOR_YELLOW, string, 1);
                       
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command!");
            }
        }
        return 1;
    }
Try that
Reply
#6

Quote:
Originally Posted by TeamPublic
Посмотреть сообщение
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]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 10)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GiveNameSpace(sendername);
                        GiveNameSpace(giveplayer);
                        if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
                        new Float:shealth;
                        GetPlayerHealth(para1,shealth);
                        SetPlayerHealthEx(para1,shealth);
                        new Float:darmour;
                        GetPlayerArmour(para1,darmour);
                        SetPlayerArmourEx(para1,darmour);
                        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_WHITE, string);
                        format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "[ID: %d]  %s has promoted %s [ID: %d] to a level %d admin.", playerid, sendername, giveplayer, para1,level);
                        ABroadCast(COLOR_YELLOW, string, 1);
                       
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command!");
            }
        }
        return 1;
    }
Try that
is this the correct one?i will try!!
Reply
#7

Yeah try it
Reply
#8

hey

teampublic i cant its says when i open samp-server is runtime error17:Unsupported P-code file
Reply
#9

Quote:
Originally Posted by PheonixButcher
Посмотреть сообщение
hey

teampublic i cant its says when i open samp-server is runtime error17:Unsupported P-code file
Not Working...What other pawno codes /makeadmin u have?
Reply
#10

no errors or warnings when you compile?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)