Help me with this command
#1

When I get Ig, and do either /gov or /m text doesn't show up.. why?

codes:
pawn Код:
if(strcmp(cmd, "/gov", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] > 0 && PlayerInfo[playerid][pMember] < 8 && DivisionInfo[PlayerInfo[playerid][pDivision]][PlayerInfo[playerid][pMember]][divCanGov])
            {
                if(PlayerInfo[playerid][pMask]) return SendClientMessage(playerid, COLOR_GREY, "You aren't allowed to use this feature while having a mask on.");
               
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[96];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/gov)ernment [text]");

                format(string, sizeof(string), "Announcement: %s %s: %s",GetPlayerRank(playerid),GetPlayerNameEx(playerid), result);
                OOCOff(COLOR_DBLUE,string);
               
                if(UseAdmCmdTimer[playerid] > 4)
                {
                    PlayerInfo[playerid][pRank] = 0;
                    PlayerInfo[playerid][pLeader] = 0;
                    PlayerInfo[playerid][pMember] = 0;
                    format(string, sizeof(string), "AdmCmd: %s (ID: %d) has been signalised spamming the (/gov) command and has been kicked from the %s.", GetPlayerNameEx(playerid), playerid, GetPlayerFactionName(playerid));
                    ABroadCast(COLOR_LIGHTRED, string, 1);
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You have been kicked from your faction due to spamming LEO commands.");
                    SetPlayerToTeamColor(playerid);
                }
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/int", true) == 0)
    {
        new
            vw,
            interior,
            vehid = GetPlayerVehicleID(playerid);

        if(vehid == EnterableShamals[0])
        {
            vw = 1337;
            interior = 1;
        }
        else if(vehid == EnterableShamals[1])
        {
            vw = 1338;
            interior = 1;
        }
        else if(vehid == EnterableShamals[2])
        {
            vw = 1339;
            interior = 1;
        }
        else return SendClientMessage(playerid,COLOR_GREY, "You're not in a vehicle with an intercom.");
       
        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)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /int [text]");
       
        format(string, sizeof(string), "[Pilot %s] says %s",GetPlayerNameEx(playerid,1),result);
        SendClientMessage(playerid,COLOR_YELLOW,string);
        foreach(Player, i)
        {
            if(GetPlayerVirtualWorld(i) == vw && GetPlayerInterior(i) == interior)
            {
                SendClientMessage(i,COLOR_YELLOW,string);
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/m", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new
                tmpcar = GetPlayerVehicleID(playerid);
               
            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)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/m)egaphone [megaphone chat]");
           
            if(PlayerInfo[playerid][pJob] == 77 || IsInFaction(playerid, "LSPD") || IsInFaction(playerid, "GOV") || IsInFaction(playerid, "LSFD") || IsInFaction(playerid, "NG") || IsInFaction(playerid, "FBI") || IsInFaction(playerid, "SASD") || IsInFaction(playerid, "CIA"))
            {
                if(!IsACopCar(tmpcar) && !IsAFBICar(tmpcar) && !IsAnAmbulance(tmpcar) && !IsANGCar(tmpcar)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Government vehicle.");
               
                if(PlayerInfo[playerid][pJob] == 77)
                {
                    format(string, sizeof(string), "[EMT %s] yells: %s", GetPlayerNameEx(playerid,1), result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                if(PlayerInfo[playerid][pMember] > 0 && PlayerInfo[playerid][pMember] < 8)
                {
                    format(string, sizeof(string), "[%s %s %s] yells: %s", GetPlayerFactionName(playerid),GetPlayerRank(playerid),GetPlayerNameEx(playerid,1), result);
                    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
            }
        }
        return 1;
    }
please help me..
Reply
#2

Bump! This is urgent, please help me
Reply
#3

Endless loop ?
Or silently crashed, do some prints
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)