Help On this msg
#1

This Script Have prob When I join I Must Not See it Just Other members who are in gang or on the faction see it
PHP код:
                if(PlayerInfo[playerid][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0)
                {
                    
format(stringsizeof(string), "*** %s from your faction has logged in."GetPlayerNameEx(playerid));
                    
SendClientMessageEx(playeridCOLOR_JUNIORADMINstring);
                }
                if(
PlayerInfo[playerid][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != 255)
                {
                    
format(stringsizeof(string), "*** %s from your gang has logged in."GetPlayerNameEx(playerid));
                    
SendClientMessageEx(playeridCOLOR_JUNIORADMINstring);
                } 
Reply
#2

Код:
                if(PlayerInfo[playerid][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0) 
                {
Faction number or any thing other there no time to explain.
Reply
#3

Quote:
Originally Posted by coool
Посмотреть сообщение
Код:
                if(PlayerInfo[playerid][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0) 
                {
Faction number or any thing other there no time to explain.
... I Just Wont See It Just others see
Reply
#4

You are not in the faction, but the others are? yes I am!!!. Even without being in any faction you get the message of faction joining. That's your problem. It is because this sentence
Код:
if(PlayerInfo[playerid][pFaction] == PlayerInfo[playerid][pFaction]
will evaluate true because you are checking if the same variables are equal. And the code nested in will run. To solve this do
Код:
if(PlayerInfo[playerid][pFaction] == //Here the appropriate number of faction)
Reply
#5

Quote:
Originally Posted by coool
Посмотреть сообщение
You are not in the faction, but the others are? yes I am!!!. Even without being in any faction you get the message of faction joining. That's your problem. It is because this sentence
Код:
if(PlayerInfo[playerid][pFaction] == PlayerInfo[playerid][pFaction]
will evaluate true because you are checking if the same variables are equal. And the code nested in will run. To solve this do
Код:
if(PlayerInfo[playerid][pFaction] == //Here the appropriate number of faction)
No Im In A faction And On Gang But i wont see that msg Just other members of faction or gang
Reply
#6

PHP код:
public OnPlayerConnect(playerid)
{
    new 
string[128];
    if(
PlayerInfo[playerid][pFaction] != 0)
    {
        
format(stringsizeof(string), "*** %s from your faction has logged in."GetPlayerNameEx(playerid));
        for(new 
i;i<MAX_PLAYER;i++)
        {
                    if(
== playerid) continue;
            if(
PlayerInfo[playerid][pFaction] == PlayerInfo[i][pFaction])
            {
                
SendClientMessage(i,-1,string);
            }
        }
    }
    return 
1;

do this method for your gang too it will work for you
Reply
#7

Delete please.
Reply
#8

PlayerInfo[playerid][pGang] == PlayerInfo[playerid][pGang]

i realy cant understand this part ? why u are using this ? they are always same like using 1=1
Reply
#9

Quote:
Originally Posted by khRamin78
Посмотреть сообщение
PlayerInfo[playerid][pGang] == PlayerInfo[playerid][pGang]

i realy cant understand this part ? why u are using this ? they are always same like using 1=1
Yes Its False I delted It
Reply
#10

Quote:
Originally Posted by khRamin78
Посмотреть сообщение
PHP код:
public OnPlayerConnect(playerid)
{
    new 
string[128];
    if(
PlayerInfo[playerid][pFaction] != 0)
    {
        
format(stringsizeof(string), "*** %s from your faction has logged in."GetPlayerNameEx(playerid));
        for(new 
i;i<MAX_PLAYER;i++)
        {
                    if(
== playerid) continue;
            if(
PlayerInfo[playerid][pFaction] == PlayerInfo[i][pFaction])
            {
                
SendClientMessage(i,-1,string);
            }
        }
    }
    return 
1;

do this method for your gang too it will work for you
Im getting this warning
warning 219: local variable "i" shadows a variable at a preceding level
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)