SA-MP Forums Archive
/aduty command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /aduty command (/showthread.php?tid=555726)



/aduty command - Mijata - 08.01.2015

Код:
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


Re: /aduty command - ZaBraNjeNi - 08.01.2015

Post errors.


Respuesta: /aduty command - JuanStone - 08.01.2015

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;
}



Re: /aduty command - HydraHumza - 08.01.2015

Please show us errors


Re: /aduty command - Mijata - 08.01.2015

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


Respuesta: /aduty command - JuanStone - 08.01.2015

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.


Re: Respuesta: /aduty command - Mijata - 08.01.2015

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


Re: /aduty command - Mijata - 08.01.2015

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


Respuesta: /aduty command - JuanStone - 08.01.2015

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.


Re: /aduty command - Mijata - 08.01.2015

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