Faction Chat help for dynamic factions
#1

ok, So I'm trying to make it so that when a player types /f it sends the message to players in his faction I can make it work with my non Dynamic faction system but when I try make it with the dynamic system it doesn't work.

code dynamic:
pawn Код:
forward SendMessageToOfficialFaction(color,const string[]);
public SendMessageToOfficialFaction(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction])
        SendClientMessage(i, color, string);
    }
    return 1;
}
Error Message Dynamic:

Код:
C:\Users\nathan\Desktop\Sa-mp v2\gamemodes\hrp.pwn(1114) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Code non dynamic:
pawn Код:
forward SendMessageToPoliceFaction(color,const string[]);
public SendMessageToPoliceFaction(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) //the admin gotta be connected
        if(PlayerInfo[i][pFaction] == 30)
        SendClientMessage(i, color, string);
    }
    return 1;
}
Reply
#2

pawn Код:
if((PlayerInfo[i][pFaction]) == (PlayerInfo[playerid][pFaction]))
Maybe try this?
Reply
#3

pawn Код:
forward SendMessageToOfficialFaction(playerid, color,const string[]);
public SendMessageToOfficialFaction(playerid, color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction])
        SendClientMessage(i, color, string);
    }
    return 1;
}
Try that
Reply
#4

pawn Код:
forward SendMessageToOfficialFaction(color,const string[]);
public SendMessageToOfficialFaction(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction]) // THIS PLAYERID IS INVALID!
        SendClientMessage(i, color, string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)