[Help] Making a group only chat.
#1

Hello. I have completed almost everything in my script related to factions except for a radio. I would like to have a command such as /r that is avaliable to Faction[playerid] = 1 so something with OnPlayerText I'm sure. But if anyone could just help me get started that would be great. If you need to see more of my factions script please ask and I am REP+(ing) anyone who can help me figure this out!

Thanks!
Reply
#2

need to see ur factions script to make one + u need 50+ post to rep.
Reply
#3

Quote:
Originally Posted by newbie scripter
View Post
need to see ur factions script to make one + u need 50+ post to rep.
I can add to your reputation at the bottom of every one of your posts. They must of changed it.

On a related note:

Code:
new Faction[MAX_PLAYERS];
Code:
#define FACTION_NONE                       0
#define SAN FIERRO POLICE DEPARTMENT       1
And here is a command using it:

Code:
CMD:m(playerid, params[])
{
if(Faction[playerid] == 1)
{
    new textv2[128];
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_NEWBIE, "SYNTAX: /low [text]");
    {
    format(textv2, sizeof(textv2), "[Megaphone] %s: %s", NAMEGET(playerid), params);
    NearMessageSender(playerid, 3, textv2,  COLOR_YELLOW, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); 
    }
    return 1;
}
return SendClientMessage(playerid, COLOR_NEWBIE, "You aren't in a law enforcment agency!");
}
Reply
#4

pawn Code:
COMMAND:r(playerid, params[])
{
    new Name[24], Msg[128], Message[128];

    GetPlayerName(playerid, Name, sizeof(Name));
    if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Syntax: /r [Message]");
    else
    {
        for (new i; i < MAX_PLAYERS; i++)
        {
           if (GetPlayerTeam[i] == EnterTeamName) //You can change it to your team that is used in your server
           {
                format(Msg, 128, "[Radio]%s[%d]: {FFFFFF}%s", Name, playerid, Message);
                SendClientMessage(i, 0xFFFFFFFF, Msg);
           }
        }
    }
    return 1;
}
This is something i made, hope it will work.
Reply
#5

Quote:
Originally Posted by iOxide
View Post
pawn Code:
COMMAND:r(playerid, params[])
{
    new Name[24], Msg[128], Message[128];

    GetPlayerName(playerid, Name, sizeof(Name));
    if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Syntax: /r [Message]");
    else
    {
        for (new i; i < MAX_PLAYERS; i++)
        {
           if (GetPlayerTeam[i] == EnterTeamName) //You can change it to your team that is used in your server
           {
                format(Msg, 128, "[Radio]%s[%d]: {FFFFFF}%s", Name, playerid, Message);
                SendClientMessage(i, 0xFFFFFFFF, Msg);
           }
        }
    }
    return 1;
}
This is something i made, hope it will work.
Else statement isnt needed.
Reply
#6

Quote:
Originally Posted by iOxide
View Post
pawn Code:
COMMAND:r(playerid, params[])
{
    new Name[24], Msg[128], Message[128];

    GetPlayerName(playerid, Name, sizeof(Name));
    if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Syntax: /r [Message]");
    else
    {
        for (new i; i < MAX_PLAYERS; i++)
        {
           if (GetPlayerTeam[i] == EnterTeamName) //You can change it to your team that is used in your server
           {
                format(Msg, 128, "[Radio]%s[%d]: {FFFFFF}%s", Name, playerid, Message);
                SendClientMessage(i, 0xFFFFFFFF, Msg);
           }
        }
    }
    return 1;
}
This is something i made, hope it will work.
You're frickin amazing mate!

Both of you REP +
Reply
#7

Quote:
Originally Posted by newbie scripter
View Post
Else statement isnt needed.
I think else statement is needed if there is no return SendClientMessage?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)