SA-MP Forums Archive
/aduty problem - 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 problem (/showthread.php?tid=470429)



/aduty problem - DarkLored - 18.10.2013

SOLVED


Re: /aduty problem - xganyx - 18.10.2013

pawn Код:
new PlayerColor[MAX_PLAYERS];

// stuff here

CMD:aduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       PlayerColor[playerid] = GetPlayerColor(playerid);
       SetPlayerColor(playerid,COLOR_PINK);
       SetPlayerHealth(playerid, 99999);
       format(string,sizeof(string),"Admin %s(%d) has switched to admin mode you are not allowed to interfer him!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}

CMD:offduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       SetPlayerColor(playerid,PlayerColor);
       SetPlayerHealth(playerid, 100);
       format(string,sizeof(string),"Admin %s(%d) is off duty now you may interfer with him now!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}



Re: /aduty problem - DarkLored - 18.10.2013

I get this error

Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2006) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
the problem is in this line

pawn Код:
SetPlayerColor(playerid,PlayerColor);



Re: /aduty problem - PT - 18.10.2013

pawn Код:
new PlayerColor[MAX_PLAYERS];

// stuff here

CMD:aduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       PlayerColor[playerid] = GetPlayerColor(playerid);
       SetPlayerColor(playerid,COLOR_PINK);
       SetPlayerHealth(playerid, 99999);
       format(string,sizeof(string),"Admin %s(%d) has switched to admin mode you are not allowed to interfer him!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}

CMD:offduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       SetPlayerToTeamColor(playerid);
       SetPlayerHealth(playerid, 100);
       format(string,sizeof(string),"Admin %s(%d) is off duty now you may interfer with him now!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}



Re: /aduty problem - DarkLored - 18.10.2013

Everything is compiling okay but it dosent change my color to pink
like i wanted


Re: /aduty problem - xganyx - 18.10.2013

Quote:
Originally Posted by PT
Посмотреть сообщение
pawn Код:
new PlayerColor[MAX_PLAYERS];

// stuff here

CMD:aduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       PlayerColor[playerid] = GetPlayerColor(playerid);
       SetPlayerColor(playerid,COLOR_PINK);
       SetPlayerHealth(playerid, 99999);
       format(string,sizeof(string),"Admin %s(%d) has switched to admin mode you are not allowed to interfer him!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}

CMD:offduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       SetPlayerToTeamColor(playerid);
       SetPlayerHealth(playerid, 100);
       format(string,sizeof(string),"Admin %s(%d) is off duty now you may interfer with him now!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}
You just re-post my post...

and you just fix the color

pawn Код:
new PlayerColor[MAX_PLAYERS];

// stuff here

CMD:aduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       PlayerColor[playerid] = GetPlayerColor(playerid);
       SetPlayerColor(playerid,16711816);
       SetPlayerHealth(playerid, 99999);
       format(string,sizeof(string),"Admin %s(%d) has switched to admin mode you are not allowed to interfer him!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}

CMD:offduty(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       new string[120];
       SetPlayerToTeamColor(playerid);
       SetPlayerHealth(playerid, 100);
       format(string,sizeof(string),"Admin %s(%d) is off duty now you may interfer with him now!",GetName(playerid),playerid);
       SendClientMessageToAll(COLOR_PINK,string);
    }
    return 1;
}



Re: /aduty problem - DarkLored - 18.10.2013

Can you help me fix this

Cause the command is working the only problem that it dosent change my color to pink
for some reason the color stays the same'

[EDIT] Nope not fixed same thing


Re: /aduty problem - xganyx - 18.10.2013

Get a color from http://colorpicker.com then use for SetPlayerColor


Re: /aduty problem - Zex Tan - 18.10.2013

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
I get this error

Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(2006) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
the problem is in this line

pawn Код:
SetPlayerColor(playerid,PlayerColor);
The argument mismatch thing, change it to
pawn Код:
SetPlayerColor(playerid, PlayerColor[playerid]);
And check if it works. Else show us your color code.


Re: /aduty problem - denNorske - 18.10.2013

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Can you help me fix this

Cause the command is working the only problem that it dosent change my color to pink
for some reason the color stays the same'

[EDIT] Nope not fixed same thing
Please show what you have defined "COLOR_PINK" as.