[ /SUSPECT ] Command help
#1

Hello everyone ! I have a little big problem .. On the command /suspect don't give stars and the suspect i'snt appear at wanted list .
Код:
if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /(su)spect [playerid/PartOfName] [wantedlevel] [reason]");
                return 1;
            }
            new playa;
            new wanted;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            wanted = strval(tmp);
            if (IsACop(playerid))
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != 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_GRAD2, "{00A1FF}USAGE{FFFFFF}: /(su)spect [playerid/PartOfName] [wlevel] [reason]");
                            return 1;
                        }
                        if (IsACop(playa))
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "   You can't suspect cops!");
                            return 1;
                        }
						if(PlayerInfo[playa][pJailed] >= 1)
						{
							SendClientMessage(playerid, COLOR_WHITE, "   This player is already in Jail!");
							return 1;
						}
                        if(wanted > 10)
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "   Wanted level must be between 1 and 10 !");
                            return 1;
                        }
                        if(wanted <= 0)
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "   Wanted level must be between 1 and 10 !");
                            return 1;
                        }
						new check = WantedLevel[playa] + wanted;
						if(check > 10)
						{
                            SendClientMessage(playerid, COLOR_WHITE, "   You went over the wanted level limit of 10 !");
                            return 1;
                        }
                        new string1[128];
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        WantedLevel[playa] += wanted;
                        WantedPoints[playa] += wanted*2;
                        format(string, sizeof(string), "You've commited a Crime ( %s ). Reporter: %s.",result,sendername);
                        SendClientMessage(playa, COLOR_LIGHTRED, string);
                        format(string1, sizeof(string1), "Current Wanted Level: %d", WantedLevel[playa]);
                        SendClientMessage(playa, COLOR_YELLOW, string1);
                        for(new i = 0; i <= MAX_PLAYERS; i++)
                        {
                            if(IsPlayerConnected(i))
                            {
                                if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1||PlayerInfo[i][pMember] == 2||PlayerInfo[i][pLeader] == 2||PlayerInfo[i][pMember] == 3||PlayerInfo[i][pLeader] == 3)
                                {
                                    format(string, sizeof(string), "HQ: All Units APB: Reporter: %s",sendername);
                                    SendClientMessage(i, TEAM_BLUE_COLOR, string);
                                    format(string, sizeof(string), "HQ: Crime: %s, Suspect: %s, WantedLevel: %d",result,giveplayer,WantedLevel[playa]);
                                    SendClientMessage(i, TEAM_BLUE_COLOR, string);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not a Cop !");
            }
        }
        return 1;
    }
Sorry for bad english .. i'am from Romania .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)