SetPlayerColor not working
#1

hello i have a problem with setplayercolor

whenever i go on duty ,according to my script my color should turn to blue but it stays white


here's the code

pawn Код:
switch(dialogid)
{
case 1:
{
if(!response)
{
SendClientMessage(playerid, COLOR_PINK2, "You Canceled");
return 1;
}
switch(listitem)
{
case 0:
{
if(gTeam[playerid] == TEAM_CIV)
{
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
OffDutySkin[playerid] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid,280);
SendClientMessage(playerid,COLOR_LAWNGREEN,"Welcome to Duty USPD Officer");
gTeam[playerid] = TEAM_COP;
}
else if(GetPlayerTeam(playerid) !=TEAM_CIV)
SendClientMessage(playerid,COLOR_PINK2,"You Cant go on Cop Duty");
}
case 1:
{
if(gTeam[playerid] == TEAM_CIV)
{
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
OffDutySkin[playerid] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid,281);
SendClientMessage(playerid,COLOR_LAWNGREEN,"Welcome to Duty USPD Officer");
gTeam[playerid] = TEAM_COP;
}
else if(GetPlayerTeam(playerid) !=TEAM_CIV)
SendClientMessage(playerid,COLOR_PINK2,"You Cant go on Cop Duty");
}
case 2:
{
if(gTeam[playerid] == TEAM_CIV)
{
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
OffDutySkin[playerid] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid,282);
SendClientMessage(playerid,COLOR_LAWNGREEN,"Welcome to Duty USPD Officer");
gTeam[playerid] = TEAM_COP;
}
else if(GetPlayerTeam(playerid) !=TEAM_CIV)
SendClientMessage(playerid,COLOR_PINK2,"You Cant go on Cop Duty");
}
case 3:
{
SendClientMessage(playerid,COLOR_PINK2,"Stay a Law full Citizen");
gTeam[playerid] = TEAM_CIV;
SetPlayerSkin(playerid, OffDutySkin[playerid]);
SetPlayerColor(playerid,COLOR_WHITE);
}
}
}
Reply
#2

Please indent. I'm sure there is some logic error in your code.
Reply
#3

Make sure that you have defined COLOR_LIGHTBLUE on very top of your script. And also make sure that you have defined the light blue color.
Reply
#4

Post your #define COLOR_LIGHTBLUE line, so then we will be able to make sure you have the proper hex value for this code.
Reply
#5

#define COLOR_LIGHTBLUE 0x33CCFFAA

and @vince i get no errors
Reply
#6

Quote:
Originally Posted by Domnic Toretto
Посмотреть сообщение
#define COLOR_LIGHTBLUE 0x33CCFFAA

and @vince i get no errors
You get no errors but you get warnings
Reply
#7

I am talking about logic errors, not syntax errors. Consider the following example:
pawn Код:
if(GetPlayerScore(playerid) < 100 && GetPlayerScore(playerid) > 100)
This is still syntactically correct and it will compile, but it obviously won't work.
Reply
#8

Try
pawn Код:
SetPlayerColor(playerid, 0x33CCFFAA);
This probably won't change anything, but there is a possibility that your client just isn't receiving the data.
Sometimes in scripts, when you set a players color, lets say you set you enter the server as a blue player. Then you set your color to red, but when you speak you're still blue? Other players might see you as red, however the change may not apply to you. Get another player on the server to tell you what color you are, as it may not be reading properly for you.
Reply
#9

Quote:
Originally Posted by Vince
Посмотреть сообщение
I am talking about logic errors, not syntax errors. Consider the following example:
pawn Код:
if(GetPlayerScore(playerid) < 100 && GetPlayerScore(playerid) > 100)
This is still syntactically correct and it will compile, but it obviously won't work.
i gave the code above it will be very help full if you check those login errors
Reply
#10

anyone?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)