Jump to content
  • 0

Problema faction chat


bossuldam

Question

Am incercat sa creez un faction chat, insa orice as face, pe server imi scrie "unknown command".

[pawn]

    if(strcmp(cmdtext, "/f", true) == 0)

    {

                            if(IsPlayerConnected(playerid))

                    {

                    GetPlayerName(playerid,sendername,sizeof(sendername));

                            new length = strlen(cmdtext);

                            while ((idx < length) && (cmdtext[idx] <= ' '))

                            {

                                    idx++;

                            }

                            new offset = idx;

                            new result[64];

                            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

                            {

                                    result[idx - offset] = cmdtext[idx];

                                    idx++;

                            }

                            result[idx - offset] = EOS;

                            if(!strlen(result)) return SendClientMessage(playerid, COLOR_BLUE, "SYNTHAX: /f(action) [message]");

                          if(gTeam[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You are not in a Faction");

                            if(gTeam[playerid] != 0)

                            {

                        new string[128],Fam = gTeam[playerid];

                        format(string,sizeof(string),"** (( %s: %s )) **",sendername,result);

                        for(new i = 0; i < MAX_PLAYERS; i++)

                            {

                            if(IsPlayerConnected(i))

                            {

                                    if(gTeam == Fam) SendClientMessage(i, COLOR_BLUE, string);

                            }

                            }

                            }

                            }

                            return 1;

                            }

[/pawn]

Codul nu e foarte complex (fara ranguri), doar daca esti intr-o factiune poti sa folosesti comanda.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.