Clan chat prob
#1

i am making clan chat for my server

Код:
CMD:cc(playerid, params[])
{
	if(PlayerInfo[playerid][prm] >= 1)
	{
        format(fstr, sizeof(fstr), "[CLAN-CHAT]: %s: %s", GetName(playerid), params);
        foreach(Player, i)
		{
            if(PlayerInfo[i][rm] >= 1 || IsPlayerrm(i))
			{
                SendClientMessage(i, YELLOW, fstr);
            }
        }
    }
    else if(PlayerInfo[playerid][rm] >= 1)
	{
        format(fstr, sizeof(fstr), "[CLAN-CHAT]: %s: %s", GetName(playerid), params);
        foreach(Player, i)
		{
            if(PlayerInfo[i][rm] >= 1)
			{
                SendClientMessage(i, YELLOW, fstr);
            }
        }
    }
    else
    {
        SendClientMessage(playerid, RED, "Only clan members can use this command.");
    }
    return true;
}
Error
Код:
D:\TDm 2.0\ilkul new wala\gamemodes\NVCNR2.pwn(25800) : error 017: undefined symbol "IsPlayerrm"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
i have copied my admin chat code and edit it like Isplayeradmin so Isplayerrm [ rm = ruskaya mafia clan name ]

Admin chat code
Код:
CMD:a(playerid, params[])
{
	if(IsPlayerAdmin(playerid))
	{
        format(fstr, sizeof(fstr), "[ADMIN-CHAT]: %s: %s", GetName(playerid), params);
        foreach(Player, i)
		{
            if(PlayerInfo[i][aLevel] >= 1 || IsPlayerAdmin(i))
			{
                SendClientMessage(i, ORANGE, fstr);
            }
        }
    }
    else if(PlayerInfo[playerid][aLevel] >= 1)
	{
        format(fstr, sizeof(fstr), "[ADMIN-CHAT]: %s: %s", GetName(playerid), params);
        foreach(Player, i)
		{
            if(PlayerInfo[i][aLevel] >= 1)
			{
                SendClientMessage(i, ORANGE, fstr);
            }
        }
    }
    else
    {
        SendClientMessage(playerid, RED, "Only admin level 1+ can use this command.");
    }
    return true;
}
Reply
#2

pawn Код:
stock IsPlayerrm(playerid)
{
if(IsPlayerConnected(playerid))
    {
if(PlayerInfo[playerid][prm] >= 1) return 1;
    return 0;
}
Add this below the command

I'll tell you what you was doing wrong.
In your cmd "a" you could find this
pawn Код:
if(IsPlayerAdmin(playerid))
because it was already defined, Which means everyone who is higher admin than level 1. Ex: 2 - 3 .. 999999.
You can in your GameMode search for it and you will find it.
So you must do the same thing so your code works, And the code I gave you is what you need.
Reply
#3

ya done ty and pls can u gv me code when some one clan chat it plays sound to like
/cc Hi dude

when he types this all clan members can hear 1 sec sound
Reply
#4

You mean sound ding ?
pawn Код:
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
Reply
#5

okey ty added repu
Reply
#6

bro where can i get all ids for sound ?
Reply
#7

https://sampwiki.blast.hk/wiki/SoundID
Reply
#8

Can u gv me code 3d text on heads of clan members
Reply
#9

pawn Код:
new Text3D:ClanLabel[MAX_PLAYERS];
To create it use this
pawn Код:
ClanLabel[playerid] = Create3DTextLabel("Clan Member",0x00AA0099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(ClanLabel[playerid], playerid, 0,0,0);
To remove it use this
pawn Код:
Delete3DTextLabel(ClanLabel[playerid]);
Reply
#10

is this possible ? Clan members should spawn on clan hq ? if yes so please give me code i will be verythank full to u i will add coords by ma self just need code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)