/aduty problem
#1

SOLVED
Reply
#2

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

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);
Reply
#4

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

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

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

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
Reply
#8

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

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)