SA-MP Forums Archive
Faction Chat help for dynamic factions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Faction Chat help for dynamic factions (/showthread.php?tid=494027)



Faction Chat help for dynamic factions - jueix - 11.02.2014

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;
}



Re: Faction Chat help for dynamic factions - $Marco$ - 11.02.2014

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


Re: Faction Chat help for dynamic factions - Flake. - 11.02.2014

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


Re: Faction Chat help for dynamic factions - Beckett - 11.02.2014

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;
}