small thing need to fix
#1

ok, when I use this cmd its works + show unknow command by server what its wrong?
pawn Код:
if(strcmp(cmd,"/c",true) == 0)
    {
        if(PlayerInfo[playerid][pClanMem] == 250) return SendClientMessage(playerid,c_r,"( ! ) You're not in a clan !");
        new string[250];
        new clanf = PlayerInfo[playerid][pClanMem];
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
        idx++;
        }
        new offset = idx;
        new result[256];
        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_WHITE, "( ! ) /c <message>");
        if(Clans[clanf][Front] == 1)
        {
            if(PlayerInfo[playerid][pClanMem] == PlayerInfo[playerid][pClanKey])
            {
                format(string,sizeof(string),"( C ) Boss [%s]%s : %s",Clans[clanf][cName],PlayerName(playerid),result);
            }
            else
            {
                format(string,sizeof(string),"( C ) [%s]%s : %s",Clans[clanf][cName],PlayerName(playerid),result);
            }
            MessageToClan(playerid,GetPlayerColor(playerid),string);
            return 1;
        }
        else
        {
            if(PlayerInfo[playerid][pClanMem] == PlayerInfo[playerid][pClanKey])
            {
                format(string,sizeof(string),"( C ) Boss %s[%s] : %s",PlayerName(playerid),Clans[clanf][cName],result);
            }
            else
            {
                format(string,sizeof(string),"( C ) %s[%s] : %s",PlayerName(playerid),Clans[clanf][cName],result);
            }
            MessageToClan(playerid,GetPlayerColor(playerid),string);
        }
        return 1;
    }


stock MessageToClan(playerid,color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new clan = PlayerInfo[i][pClanMem];
        if(IsPlayerConnected(i) == 1) if(clan == PlayerInfo[playerid][pClanMem]) SendClientMessage(i, color, string);
    }
return 1;
}
Reply
#2

any one?
Reply
#3

Have u tried "return 1" in the stock ?
Becouse ur only checking and formatting thins and the only thats left of a function is the stock!
Reply
#4

See if you're returning 0 at the end of OnPlayerCommandText. Also check your FSs and GMs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)