/aduty command
#1

Код:
CMD:aduty(playerid,params[])
{
     if(pInfo[playerid][pLevel] >= 1)
     {
     
    new skin = GetPlayerSkin(playerid);

    if(OnDuty[playerid] == 0)
    {
        SetPlayerSkin(playerid,217);
        SetPlayerHealth(playerid,100000);
        SetPlayerColor(playerid, 0x01FCFFFF);
        OnDuty[playerid] = 1;
    }
    else
    {
        SetPlayerSkin(playerid,skin);
        SetPlayerHealth(playerid,100);
        SetPlayerColor(playerid 0xFFFFFFFF);
        OnDuty[playerid] = 0;
    }
    return 1;
}
what is problem here i have errors i want this command only for admins
Reply
#2

Post errors.
Reply
#3

What is the problem, you just want the command for administrators only rcon ?. which variable is the administrator of his script ?.

pawn Код:
CMD:aduty(playerid,params[])
{
    if(pInfo[playerid][pLevel] >= 1)
    {
        new skin[MAX_PLAYERS];
        if(OnDuty[playerid] == 0)
        {
            skin[playerid] = GetPlayerSkin(playerid);
            SetPlayerSkin(playerid, 217);
            SetPlayerHealth(playerid,100000);
            SetPlayerColor(playerid, 0x01FCFFFF);
            OnDuty[playerid] = 1;
        }
        else if(OnDuty[playerid] == 1)
        {
            SetPlayerSkin(playerid, skin[playerid]);
            SetPlayerHealth(playerid, 100);
            SetPlayerColor(playerid 0xFFFFFFFF);
            OnDuty[playerid] = 0;
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not administrator.");
    }
    return true;
}
Reply
#4

Please show us errors
Reply
#5

Quote:

.pwn(441) : error 017: undefined symbol "CreateLoginTextDraw"
.pwn(893) : error 017: undefined symbol "LoadSettings"
.pwn(89 : error 017: undefined symbol "PrintConfiguration"
.pwn(900) : error 017: undefined symbol "LoadIllegalWeaps"
.pwn(901) : error 017: undefined symbol .pwn(902) : error 017: undefined symbol "LoadBadNickParts"
.pwn(903) : error 017: undefined symbol "LoadBadWords"
.pwn(904) : error 004: function "LoadTeleports" is not implemented
.pwn(1033) : error 017: undefined symbol "CreateSpecTD"
.pwn(1061) : error 017: undefined symbol "SendToAdmins"
.pwn(1064) : error 017: undefined symbol "SendToAdmins"
.pwn(1070) : error 017: undefined symbol "SendToAdmins"
.pwn(1119) : error 017: undefined symbol "IsForbiddenNick"
.pwn(1125) : error 017: undefined symbol "SendToAdmins"
.pwn(1126) : error 017: undefined symbol "WriteToLog"
.pwn(112 : error 017: undefined symbol "IsBadNickPart"
.pwn(1134) : error 017: undefined symbol "SendToAdmins"
.pwn(1135) : error 017: undefined symbol "WriteToLog"
.pwn(1171) : error 017: undefined symbol "LeavingCAPZONE"
.pwn(1221) : error 017: undefined symbol "SendToAdmins"
.pwn(1240) : error 017: undefined symbol "SpecNext"
.pwn(1241) : error 017: undefined symbol "GameTextForPlayerEx"
.pwn(128 : error 017: undefined symbol "SendToAdmins"
.pwn(1290) : error 017: undefined symbol "WriteToLog"
.pwn(1297) : error 017: undefined symbol "SendToAdmins"
.pwn(1299) : error 017: undefined symbol "WriteToLog"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

eto ti / use

and when player turn off duty i want again default color of player
Reply
#6

ty

pawn Код:
CMD:aduty(playerid, params[])
{
    if(pInfo[playerid][pLevel] >= 1)
    {
        new skin[MAX_PLAYERS];
        if(OnDuty[playerid] == 0)
        {
            skin[playerid] = GetPlayerSkin(playerid);
            SetPlayerSkin(playerid, 217);
            SetPlayerHealth(playerid, 100000);
            SetPlayerColor(playerid, 0x01FCFFFF);
            OnDuty[playerid] = 1;
        }
        else if(OnDuty[playerid] == 1)
        {
            SetPlayerSkin(playerid, skin[playerid]);
            SetPlayerHealth(playerid, 100);
            SetPlayerColor(playerid, 0xFFFFFFFF);
            OnDuty[playerid] = 0;
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not administrator.");
    }
    return true;
}
Edi: Show lines the errors mijata.

Edit two: Test with the code from this comment, eh edited.
Reply
#7

Quote:
Originally Posted by JuanStone
Посмотреть сообщение
What is the problem, you just want the command for administrators only rcon ?. which variable is the administrator of his script ?.

pawn Код:
CMD:aduty(playerid,params[])
{
    if(pInfo[playerid][pLevel] >= 1)
    {
        new skin[MAX_PLAYERS];
        if(OnDuty[playerid] == 0)
        {
            skin[playerid] = GetPlayerSkin(playerid);
            SetPlayerSkin(playerid, 217);
            SetPlayerHealth(playerid,100000);
            SetPlayerColor(playerid, 0x01FCFFFF);
            OnDuty[playerid] = 1;
        }
        else if(OnDuty[playerid] == 1)
        {
            SetPlayerSkin(playerid, skin[playerid]);
            SetPlayerHealth(playerid, 100);
            SetPlayerColor(playerid 0xFFFFFFFF);
            OnDuty[playerid] = 0;
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not administrator.");
    }
    return true;
}
Код:
.pwn(10621) : warning 209: function "cmd_dskin" should return a value
.pwn(10652) : error 001: expected token: ",", but found "-integer value-"
.pwn(10652) : warning 215: expression has no effect
.pwn(10652) : error 001: expected token: ";", but found ")"
.pwn(10652) : error 029: invalid expression, assumed zero
.pwn(10652) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
i fixed thanks
Reply
#8

but why player have cj skin when turn off /duty and why have white color
Reply
#9

Not understand what your comentary , could you explain, i'm sorry, it is not my native language the english but i would love to help you, the problem is that I do not understand, use the edit option and let a better explanation.
Reply
#10

now when player turn off duty have black color and again cj skin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)