SA-MP Forums Archive
/fchat - 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: /fchat (/showthread.php?tid=656328)



/fchat - Jaua10 - 13.07.2018

Hey guys im tryint to implement a /fchat in my gm buy i got this problem cuz i dont know hot to define it correctly:

PHP код:
CMD:fchat(playeridparams[])
    {
        if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_CORRECTION"You're not logged in.");
        if(!
isnull(params))
        {
            new 
string[560];
            if (
PlayerInfo[playerid][pLeader] > || PlayerInfo[playerid][pMember] > 0)
            {
                new 
member PlayerInfo[playerid][pMember];
                if(
member==1)
                {
                    if(
PlayerInfo[playerid][pFaction] == 6) { format(stringsizeof(string), "{99B8F5}[FACTION] (( Commissary %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 5) { format(stringsizeof(string), "(( SubCommissary %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 4) { format(stringsizeof(string), "(( Mayor %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 3) { format(stringsizeof(string), "(( SubMayor %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 2) { format(stringsizeof(string), "(( Official %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 1) { format(stringsizeof(string), "(( Cadet %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else { 
format(stringsizeof(string), "(( Helper %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    
SendFamilyMessage(PlayerInfo[playerid][pMember], 0x7BDDA5AAstring);
                }
                return 
1;
            }
            else 
SendClientMessage(playeridCOLOR_CORRECTION"You're not in a faction !");
        }
        else 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /f [Text]");
    return 
1;
    } 
Код HTML:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2583) : error 017: undefined symbol "SendFamilyMessage"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2590) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
can you give me a hand plase?


Re: /fchat - Florin48 - 13.07.2018

the SendFamilyMessage function was not created or something is wrong with it.


Re: /fchat - Jaua10 - 13.07.2018

how can i create it correctly?


Re: /fchat - JasonRiggs - 13.07.2018

Stop copying from other gamemodes without knowing what are the requirements of the system!! You need to loop through all players and see if any of them is in the same gang of the sender, and send him a message.


Re: /fchat - Jaua10 - 13.07.2018

Quote:
Originally Posted by Jaua10
Посмотреть сообщение
Hey guys im tryint to implement a /fchat in my gm buy i got this problem cuz i dont know hot to define it correctly:

PHP код:
CMD:fchat(playeridparams[])
    {
        if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_CORRECTION"You're not logged in.");
        if(!
isnull(params))
        {
            new 
string[560];
            if (
PlayerInfo[playerid][pLeader] > || PlayerInfo[playerid][pMember] > 0)
            {
                new 
member PlayerInfo[playerid][pMember];
                if(
member==1)
                {
                    if(
PlayerInfo[playerid][pFaction] == 6) { format(stringsizeof(string), "{99B8F5}[FACTION] (( Commissary %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 5) { format(stringsizeof(string), "(( SubCommissary %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 4) { format(stringsizeof(string), "(( Mayor %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 3) { format(stringsizeof(string), "(( SubMayor %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 2) { format(stringsizeof(string), "(( Official %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else if(
PlayerInfo[playerid][pFaction] == 1) { format(stringsizeof(string), "(( Cadet %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    else { 
format(stringsizeof(string), "(( Helper %s{FFFFFF}: %s {99B8F5}))"GetName(playerid), params); }
                    
SendFamilyMessage(PlayerInfo[playerid][pMember], 0x7BDDA5AAstring);
                }
                return 
1;
            }
            else 
SendClientMessage(playeridCOLOR_CORRECTION"You're not in a faction !");
        }
        else 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /f [Text]");
    return 
1;
    } 
Код HTML:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2583) : error 017: undefined symbol "SendFamilyMessage"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2590) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
can you give me a hand plase?
any help pls?


Re: /fchat - Dayrion - 13.07.2018

Quote:
Originally Posted by Jaua10
Посмотреть сообщение
any help pls?
Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Stop copying from other gamemodes without knowing what are the requirements of the system!! You need to loop through all players and see if any of them is in the same gang of the sender, and send him a message.
Ї\_(ツ)_/Ї


Re: /fchat - RedGun2015 - 13.07.2018

Quote:
Originally Posted by Jaua10
Посмотреть сообщение
any help pls?
take this and put in the gamemode
Код:
stock SendFamilyMessage(group, const colour, const string[])
{
       foreach(new i : Player) if(PlayerInfo[i][pGroup] == group) SendClientMessage(i, colour, string);
       return 1;
}



Re: /fchat - DerickClark - 13.07.2018

Please add this to your gamemode

OnPlayerSpawn so you can fix your gamemode .
Код:
Kick(playerid);



Re: /fchat - Jaua10 - 13.07.2018

Quote:
Originally Posted by RedGun2015
Посмотреть сообщение
take this and put in the gamemode
Код:
stock SendFamilyMessage(group, const colour, const string[])
{
       foreach(new i : Player) if(PlayerInfo[i][pGroup] == group) SendClientMessage(i, colour, string);
       return 1;
}
Код:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(353) : error 017: undefined symbol "pGroup"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(353) : error 035: argument type mismatch (argument 3)
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(351) : warning 203: symbol is never used: "string"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2635) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: /fchat - Jaua10 - 13.07.2018

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Please add this to your gamemode

OnPlayerSpawn so you can fix your gamemode .
Код:
Kick(playerid);
@DerickClark I got this: http://prntscr.com/k65mcg