25.09.2011, 09:37
Hello, Every time I try to make the /faction command compatible with the GF Familys, The Pawn Compiler Crashes
Could someone make it so that GF Edit Familys can also use the same chat? Please
pawn Код:
if(strcmp(cmd, "/faction", true) == 0 || strcmp(cmd, "/f", true) == 0)
{
if(IsPlayerConnected(playerid))
{
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))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/f)action [Radio Chat]");
return 1;
}
switch (PlayerInfo[playerid][pMember])
{
case 1:
{
format(string, sizeof(string), "(( %s %s: %s ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(1, COLOR_FACTIONOOC, string);
}
case 2:
{
format(string, sizeof(string), "(( %s %s: %s ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(2, COLOR_FACTIONOOC, string);
}
case 3:
{
format(string, sizeof(string), "(( %s %s: %s ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(3, COLOR_FACTIONOOC, string);
}
case 4:
{
format(string, sizeof(string), "(( %s %s: %s. ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(4, COLOR_FACTIONOOC, string);
}
case 5:
{
format(string, sizeof(string), "(( %s %s: %s. ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(5, COLOR_FACTIONOOC, string);
}
case 6:
{
format(string, sizeof(string), "(( %s %s: %s. ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(6, COLOR_FACTIONOOC, string);
}
case 7:
{
format(string, sizeof(string), "(( %s %s: %s ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(7, COLOR_FACTIONOOC, string);
}
case 8:
{
format(string, sizeof(string), "(( %s %s: %s. ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(8, COLOR_FACTIONOOC, string);
}
case 9:
{
format(string, sizeof(string), "(( %s %s: %s. ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(9, COLOR_FACTIONOOC, string);
}
case 10:
{
format(string, sizeof(string), "(( %s %s: %s. ))", GetPlayerRank(playerid), RemoveUnderScore(PlayerName(playerid)), result);
SendRadioMessage(10, COLOR_FACTIONOOC, string);
}
default: SendClientMessage(playerid, COLOR_GRAD2, " You are not part of a Team!");
}
}
return 1;
}