PLAYER COLOR
#1

PHP код:
public wantedcolor()
{
    new 
wl,c;
    for(new 
d,g=GetMaxPlayers(); d<gd++) if(IsPlayerConnected(d) && !IsPlayerNPC(d))
    {
        
wl=GetPlayerWantedLevel(d);
        if(
wl == && gTeam[d] == CIVILIANS)
        {
            
GetPlayerColor(d);
            if(
!= BLANCO)
            
SetPlayerColor(d,BLANCO);
        }
        if(
wl >= && wl <= 3)
        {
            
GetPlayerColor(d);
            if(
!= AMARILLO)
            
SetPlayerColor(d,AMARILLO);
        }
        if(
wl >= 4)
        {
        
GetPlayerColor(d);
        if(
!= ROJO)
        
SetPlayerColor(d,ROJO);
        }
    }
    else if(
pData[d][pAdmin] == && IsOnduty{d} == && wl == 0)
    {
        
GetPlayerColor(d);
        
SetPlayerColor(d,COLOR_ADMIN);
        return 
1;
    }
    return 
1;

What's wrong with it. Its working fine but only IsonDuty not working? any idea whats wrong there?
Reply
#2

else if(pData[d][pAdmin] == 1 && IsOnduty{d} == 1 && wl == 0)
{
c = GetPlayerColor(d);
SetPlayerColor(d,COLOR_ADMIN);
return 1;
}
d is not defined for that like because its out of the "for" function(the place you define d).
Reply
#3

PHP код:
if(!= BLANCO)
            
SetPlayerColor(d,BLANCO); 
If the player's color already is BLANCO it won't be changed and if it isn't BLANCO it will be changed to BLANCO. So in the end the player's color will always be BLANCO, rendering this check (and other similar ones) completely pointless.
Reply
#4

Well, Duty worked. THank VInce. Also, I did what you told me about mysql. Its working so good.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)