OnPlayerConnect
#1

hi I want to make a different this for admins.. but it dosent work.. you know what im trying to do bye the variables..tried for one hour and im sick..of this..

PHP код:
        if(PlayerInfo[playerid][pAdmin] >= 1)
                    {
                        new 
str[128];
                        new 
nume[24];
                        new 
plrIP[16];
                        
GetPlayerName(playeridnumesizeof nume);
                        
GetPlayerIp(playeridplrIPsizeof(plrIP));
                        
gpci(playeridCodesizeof(Code));
                        
format(strsizeof(str), "<UnionZone Bot> %s id: %d s-a conectat pe server. Ip: %s",nume,playerid,plrIP);
                        
SendStaffMessage(COLOR_REDstr);
                        new 
ymd;
                        new 
h,mi,s;
                        
getdate(y,m,d);
                        
gettime(h,mi,s);
                        
format(strsizeof(str), "(%d/%d/%d)[%d:%d:%d] Adminul %s a intrat in Server! [[ IP: %s ]] [SERIE: %s]",d,m,y,h,mi,s,nume,plrIP,Code);
                        
AIntrareLog(str);
                        
printf("AIntrare");
                        return 
1;
                    }
                    else if(
PlayerInfo[playerid][pAdmin] < 1)
                    {
                        new 
str[128];
                        new 
nume[24];
                        new 
plrIP[16];
                        
GetPlayerName(playeridnumesizeof nume);
                        
GetPlayerIp(playeridplrIPsizeof(plrIP));
                        
gpci(playeridCodesizeof(Code));
                        
format(strsizeof(str), "<UnionZone Bot> %s id: %d s-a conectat pe server. Ip: %s",nume,playerid,plrIP);
                        
SendStaffMessage(COLOR_ORANGEstr);
                        new 
ymd;
                        new 
h,mi,s;
                        
getdate(y,m,d);
                        
gettime(h,mi,s);
                        
format(strsizeof(str), "(%d/%d/%d)[%d:%d:%d] %s a intrat in Server! [[ IP: %s ]] [SERIE: %s]",d,m,y,h,mi,s,nume,plrIP,Code);
                        
IntrareLog(str);
                        
printf("Intrare");
                        return 
1;
                    } 
Reply
#2

Just change
Код:
else if(PlayerInfo[playerid][pAdmin] < 1)
to

Код:
else
And if that doesn't work, try this.

Код:
else if(PlayerInfo[playerid][pAdmin] == 0)
Reply
#3

player need to be logged in
Reply
#4

need to be logged In??
Reply
#5

Seems You Used A Translator... We can't understand what are u trying to do... i get mind blown while reading that.

If you want to work this with admins, do:
pawn Код:
if(IsPlayerAdmin(playerid))
but that needs to be the player is logged to RCON.
Reply
#6

Solved:

Try:
Quote:

if(PlayerInfo[playerid][pAdmin] >= 1)
{
new str[128];
new nume[24];
new plrIP[16];
GetPlayerName(playerid, nume, sizeof nume);
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
gpci(playerid, Code, sizeof(Code));
format(str, sizeof(str), "<UnionZone Bot> %s id: %d s-a conectat pe server. Ip: %s",nume,playerid,plrIP);
SendStaffMessage(COLOR_RED, str);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(str, sizeof(str), "(%d/%d/%d)[%d:%d:%d] Adminul %s a intrat in Server! [[ IP: %s ]] [SERIE: %s]",d,m,y,h,mi,s,nume,plrIP,Code);
AIntrareLog(str);
printf("AIntrare");
return 1;
}
else if(PlayerInfo[playerid][pAdmin] <= 1)
{
new str[128];
new nume[24];
new plrIP[16];
GetPlayerName(playerid, nume, sizeof nume);
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
gpci(playerid, Code, sizeof(Code));
format(str, sizeof(str), "<UnionZone Bot> %s id: %d s-a conectat pe server. Ip: %s",nume,playerid,plrIP);
SendStaffMessage(COLOR_ORANGE, str);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(str, sizeof(str), "(%d/%d/%d)[%d:%d:%d] %s a intrat in Server! [[ IP: %s ]] [SERIE: %s]",d,m,y,h,mi,s,nume,plrIP,Code);
IntrareLog(str);
printf("Intrare");
return 1;
}

HIGHLIGHTED RED to show the common error.
Reply
#7

Yes, exactly as RGOImpact said, you need to use:
"<=" which means lower than(below level)
">=" which means greater than(above level)
Reply
#8

thanks fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)