PDA

View Full Version : Proxdetector Help please


banner
04/10/2011, 10:01 PM
hey guys, in the server im editing a bit im trying to make it so that player names for certain factions are different...such as cops being blue, firemen being red...etc...now normally "setplayercolor" would work for this, but in this server there is a proxdetector that is messing with me just being able to set player color....i found the freecop code and tried changing the setplayercolor to blue but it was a no go.....so then someone mentioned something about a proxdetector that was in the script....im not positive how it works completely so i have no idea where to start looking to change faction colors...maybe if you see this peice of script someone can guide me a little.....rep+ for helping out....



if(IsAFreecop(playerid))
{
format(string, sizeof(string), "* Voluntary Officer %s took a Badge and a Gun from his locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 41, 150);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 3, 0);
SetPlayerColor(playerid,0xa9c4e400); <--tried turning this to blue,no luck
PlayerInfo[playerid][pDuty] = 1;
PlayerInfo[playerid][pChar] = 71;
new factionskin = PlayerInfo[playerid][pChar];
SetPlayerSkin(playerid, factionskin);
SaveGuns(playerid);
return 1;





so im assuming after a little bit of forum help that this line;

"ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);"

is what is messing with me and not allowing me to change player colors....i tried just deleting it to see if i setplaycolor would start working....no luck again...

i also tried making a define for the color blue and placing that in the procdetector line by adding a COLOR_CHAT6 option and defining it as blue and then turning the prox line to ,

"ProxDetector(30.0, playerid, string, COLOR_CHAT6,COLOR_CHAT6,COLOR_CHAT6,COLOR_CHAT6,CO LOR_CHAT6);"

but that didnt work either...IM SO LOST....:( ...any idea guys? its Ravens RP if that makes things easier

Yamoo
04/10/2011, 11:57 PM
COLOR_CHAT not CO LOR

banner
05/10/2011, 12:41 AM
that was just a typo from copying and pasting it over, it isnt like that in the script....i also found this peice of code in the script



public SetPlayerToTeamColor(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pWanted] == 0)
{
SetPlayerColor(playerid,TEAM_HIT_COLOR); // white
}
else
{
SetPlayerColor(playerid, 0xFF990000);
}
if(PlayerInfo[playerid][pDuty] == 1)
{
if(IsAFreecop(playerid)) { SetPlayerColor(playerid, 0xa9c4e400); }
if(PlayerInfo[playerid][pRank] == 1) { SetPlayerColor(playerid,0x33CCFF00); }
else if(PlayerInfo[playerid][pRank] == 2) { SetPlayerColor(playerid,0x2641FE00); }
else if(PlayerInfo[playerid][pRank] == 3) { SetPlayerColor(playerid,0x2641FE00); }
else if(PlayerInfo[playerid][pRank] == 4) { SetPlayerColor(playerid,0x2641FE00); }
else if(PlayerInfo[playerid][pRank] == 5) { SetPlayerColor(playerid,0x3333CC00); }
else if(PlayerInfo[playerid][pRank] == 6) { SetPlayerColor(playerid,0x3333CC00); }
else if(PlayerInfo[playerid][pRank] == 7) { SetPlayerColor(playerid,0x3333CC00); }
else if(PlayerInfo[playerid][pRank] == 8) { SetPlayerColor(playerid,0x3333CC00); }
}
if(JobDuty[playerid] == 1)
{
if(IsAFiremen(playerid)) { SetPlayerColor(playerid, 0xAA333300); }
if(IsAMedic(playerid)) { SetPlayerColor(playerid, 0xFF828200); }
}
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 1) { SetPlayerColor(playerid,0xFF66FF00); }
if(PlayerInfo[playerid][pAdmin] >= 3) { SetPlayerColor(playerid,0xFF550000); }
if(PlayerInfo[playerid][pAdmin] >= 6) { SetPlayerColor(playerid,0xFF000000); }
}
if(PlayerInfo[playerid][pTesterDuty] == 1)
{
if(PlayerInfo[playerid][pTester] == 1) { SetPlayerColor(playerid,0x00660000); }
if(PlayerInfo[playerid][pTester] == 2) { SetPlayerColor(playerid,0x00880000); }
if(PlayerInfo[playerid][pTester] == 3) { SetPlayerColor(playerid,0x00AA0000); }
}
if (TransportDuty[playerid] >= 1)
{
SetPlayerColor(playerid, 0x00FF0000);
}
if (PlayerInfo[playerid][pJob] == 3)
{
SetPlayerColor(playerid, 0xFF33FF00);
}
}
}



this looks like the area where player colors are being defined yet i changed the colors on these aswell and everyones name is still white...i can clearly see that /duty, medic, fireman etc are supposed to have different colors but everyones name stays white....:(