15.04.2012, 18:04
(
Последний раз редактировалось mineralo; 16.04.2012 в 09:58.
)
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;
}