/fchat
#1

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?
Reply
#2

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

how can i create it correctly?
Reply
#4

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.
Reply
#5

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?
Reply
#6

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.
Ї\_(ツ)_/Ї
Reply
#7

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;
}
Reply
#8

Please add this to your gamemode

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

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)