/su help
#1

When i click on Misdemeanors or Felonies nothing happends mabye someone can help, thanks in advance.


pawn Код:
CMD:su(playerid, params[])
{
    if(IsACop(playerid))
    {
        if(PlayerInfo[playerid][pJailTime] > 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");

        new iTargetID;

        if(sscanf(params, "u", iTargetID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: (/su)spect [player]");
        if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
        if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot place charges on yourself.");
        if(IsACop(iTargetID) && arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == arrGroupData[PlayerInfo[iTargetID][pMember]][g_iAllegiance])
        {
            if(arrGroupData[PlayerInfo[playerid][pMember]][gLEOArrest] == INVALID_RANK || arrGroupData[PlayerInfo[playerid][pMember]][gLEOArrest] > PlayerInfo[playerid][pRank]) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command on a law enforcement officer.");
        }
        if(PlayerInfo[iTargetID][pWantedLevel] >= 6) return SendClientMessageEx(playerid, COLOR_GRAD2, "Target is already most wanted.");

        ShowCrimesDialog(playerid, iTargetID);
    }
    else SendClientMessageEx(playerid, COLOR_GRAD2, "You're not a law enforcement officer.");
    return 1;
}
pawn Код:
stock ShowCrimesDialog(iPlayerID, iSuspectID = INVALID_PLAYER_ID, iDialogID = DIALOG_SHOW_CRIMES)
{
    szMiscArray[0] = 0;
    switch(iDialogID)
    {
        case DIALOG_SHOW_CRIMES:
        {
            format(szMiscArray, sizeof(szMiscArray), "----Misdemeanors----\n");
            for(new i = 0; i < MAX_CRIMES; i++)
            {
                if(arrCrimeData[i][c_iNation] == arrGroupData[PlayerInfo[iPlayerID][pMember]][g_iAllegiance] && arrCrimeData[i][c_iType] == 1)
                {
                    format(szMiscArray, sizeof(szMiscArray), "%s{FFFF00}%i\t%s\n", szMiscArray, arrCrimeData[i][c_iID], arrCrimeData[i][c_szName]);
                }
            }
            format(szMiscArray, sizeof(szMiscArray), "%s----Felonies----\n", szMiscArray);
            for(new i = 0; i < MAX_CRIMES; i++)
            {
                if(arrCrimeData[i][c_iNation] == arrGroupData[PlayerInfo[iPlayerID][pMember]][g_iAllegiance] && arrCrimeData[i][c_iType] == 2)
                {
                    format(szMiscArray, sizeof(szMiscArray), "%s{AA3333}%i\t%s\n", szMiscArray, arrCrimeData[i][c_iID], arrCrimeData[i][c_szName]);
                }
            }
            SetPVarInt(iPlayerID, "suspect_TargetID", iSuspectID);
            ShowPlayerDialogEx(iPlayerID, iDialogID, DIALOG_STYLE_LIST, "Select a committed crime", szMiscArray, "Select", "Exit");
        }
        case DIALOG_EDIT_CRIMES:
        {
            ShowPlayerDialogEx(iPlayerID, iDialogID, DIALOG_STYLE_LIST, "Select a Nation.", "SA\nNE", "Select", "Exit");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)