18.11.2016, 08:29
I have no idea how to fix the error, any help is appreciated.
PHP код:
#define POLICE 2
#define AP 3
if(strcmp(cmd, "/dr", true) == 0 || strcmp(cmd, "/dept", true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new DeptName[10];
new name[24];
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: (/dr) [team chat]");
return 1;
}
if(gTeam[playerid] == POLICE) DeptName = "SASP";
else if(gTeam[playerid] == AP) DeptName = "Agency";
GetPlayerName(playerid, name, 24);
SendFactionMessage(result, POLICE, AP); // <------The error line
return 1;
}
stock SendFactionMessage(DeptName,name,result[],faction2, faction3)
{
for(new i=0; i < MAX_PLAYERS ;i++)
{
if(IsPlayerConnected(i))
{
if(gTeam[i] == faction2 || gTeam[i] == faction3)
{
SendClientMessage(i,COLOR_ORANGE,gstr);
format(gstr, sizeof(gstr), "[%s] %s says: %s", DeptName, name, result);
}
}
}
}