Hello guys, my /suspect works but doesn't givet he player a wanted level and star.
Код:
if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /suspect [playerid] [crime]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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:] /suspect [playerid] [crime]");
return 1;
}
if(CopOnDuty[playerid])
{
if(giveplayerid != playerid)
{
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
format(string, sizeof(string), "[Info:] You have been suspected by %s, Reason: %s", GetPlayerNameEx(playerid),result);
SendClientMessage(giveplayerid, COLOR_RED, string);
format(string, sizeof(string), "[Info:] You have suspected %s, Reason: %s", GetPlayerNameEx(giveplayerid),result);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "[LSPD:] %s has suspected %s, Reason: %s", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid),result);
SendFactionTypeMessage(1,COLOR_LSPD,string);
new location[MAX_ZONE_NAME];
GetPlayer2DZone(giveplayerid, location, MAX_ZONE_NAME);
format(string, sizeof(string), "[LSPD:] All units be on the lookout for %s - Person Last Seen: %s", GetPlayerNameEx(giveplayerid),location);
SendFactionTypeMessage(1,COLOR_LSPD,string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You can't suspect yourself");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not on duty");
}
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not in the correct faction");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid ID");
return 1;
}
return 1;
}