you are not a cop error & suspect killed
#7

this is the invite cmd
pawn Код:
if(strcmp(cmd, "/invite", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD2, "USAGE: /invite [playerid/PartOfName]");
                return 1;
            }
            new para1;
            new ftext[20];
            para1 = ReturnUser(tmp);
            if (PlayerInfo[playerid][pLeader] >= 1)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
                        {
                            if(PlayerInfo[para1][pJob] > 0)
                            {
                                SCM(playerid, COLOR_GREY, "   Can't invite him, player has a Job !");
                                return 1;
                            }
                            if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 280; SetPlayerSkin(para1, 280); }
                            else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI/ATF"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
                            else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "National Guard"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
                            else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Firemen/Ambulance"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
                            else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Corleone"; ChosenSkin[para1] = 258; SetPlayerSkin(para1, 120); }
                            else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Barzini "; ChosenSkin[para1] = 120; SetPlayerSkin(para1, 258); }
                            else if(PlayerInfo[playerid][pLeader] == 7) { return 1; }
                            else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 127; SetPlayerSkin(para1, 127); }
                            else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "CNN Studio"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148); }
                            else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Cab Company"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
                            else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }
                            else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "The Nang Boys"; ChosenSkin[para1] = 184; SetPlayerSkin(para1, 184); }
                            else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Underground Street"; ChosenSkin[para1] = 24; SetPlayerSkin(para1, 24); }
                            else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Ballas"; ChosenSkin[para1] = 104; SetPlayerSkin(para1, 104); }
                            else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Grove"; ChosenSkin[para1] = 271; SetPlayerSkin(para1, 271); }
                            else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Los Santos Vagos"; ChosenSkin[para1] = 110; SetPlayerSkin(para1, 110); }
                            else if(PlayerInfo[playerid][pLeader] == 17) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Tow Car Company"; ChosenSkin[para1] = 50; SetPlayerSkin(para1, 50); }
                            else { return 1; }
                            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
                            PlayerInfo[para1][pRank] = 1;
                            PlayerInfo[para1][pFwarn] = 0;
                            printf("AdmCmd: %s has invited %s to join %s.", sendername, giveplayer, ftext);
                            format(string, sizeof(string), "   You have Joined the %s, you were invited by Leader %s", ftext, sendername);
                            SCM(para1, COLOR_LIGHTBLUE, string);
                            format(string, sizeof(string), "   You have Invited %s to join the %s.", giveplayer,ftext);
                            SCM(playerid, COLOR_LIGHTBLUE, string);
                            SetPlayerInterior(para1,0);
                            new rand = random(sizeof(gInviteSpawns));
                            SetPlayerPos(para1, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
                            SetPlayerFacingAngle(para1, gInviteSpawns[rand][3]);
                            SetPlayerCameraPos(para1,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
                            SetPlayerCameraLookAt(para1,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
                            TogglePlayerControllable(para1, 0);
                            SelectChar[para1] = 255;
                            SelectCharID[para1] = PlayerInfo[para1][pMember];
                            SelectCharPlace[para1] = 1;
                            PlayerInfo[para1][pModel] = ChosenSkin[para1];
                            PlayerInfo[para1][pChar] = ChosenSkin[para1];
                            SCM(para1, COLOR_LIGHTRED, "* Use 'next' to Select the char you want to use.");
                            SCM(para1, COLOR_LIGHTRED, "* If you've found the Char you want to use, type 'done'.");
                        }
                        else
                        {
                            SCM(playerid, COLOR_GREY, "  That player is currently Wanted / a Different Team / or already a Family Member.");
                            return 1;
                        }
                    }
                }//not connected
            }
        }
        return 1;
    }
and this is the makeleader command

pawn Код:
if(strcmp(cmd, "/makeleader", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD2, "USAGE: /makeleader [playerid/PartOfName] [Number(1-16)]");
                SCM(playerid, COLOR_WHITE, "ID = 1 = Police Force || ID = 2 = FBI || ID = 3 = National Guard || ID = 4 = Ambulance ||");
                SCM(playerid, COLOR_WHITE, "ID = 5 = Corleone || ID = 6 = Barzini  || ID = 7 Presedinte || ID = 8 = Hitman ||");
                SCM(playerid, COLOR_WHITE, "ID = 9 = News Reporter || ID = 10 = Taxi || ID = 11 = School Instructor || ID = 12 = The Nang Boys ||");
                SCM(playerid, COLOR_WHITE, "ID = 13 = Underground Street Tunning || ID = 14 = Ballas || ID = 15 Grove || ID = 16 Los Santos Vagos");
                SCM(playerid, COLOR_WHITE, "ID = 17 = Tow Car Company");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(level > 17 || level < 0) { SCM(playerid, COLOR_GREY, "   Dont go below number 0, or above number 17!"); return 1; }
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
                        {
                            SCM(playerid, COLOR_GREY, "   That player is in a Faction / Family !");
                            return 1;
                        }
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pLeader] = level;
                        PlayerInfo[para1][pRank] = 6;
                        SetPlayerHealth(para1, 0.0);
                        format(string, sizeof(string), "   You have been promoted to Leader to your requested Faction by Admin %s", sendername);
                        SCM(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   You have given %s control to run Faction Number %d.", giveplayer,level);
                        SCM(playerid, COLOR_LIGHTBLUE, string);
                        if(level == 0) { PlayerInfo[para1][pChar] = 0; }
                        else if(level == 1) { PlayerInfo[para1][pChar] = 71; } //Police Force
                        else if(level == 2) { PlayerInfo[para1][pChar] = 285; } //FBI/ATF
                        else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //National Guard
                        else if(level == 4) { PlayerInfo[para1][pChar] = 228; } //Fire/Ambulance
                        else if(level == 5) { PlayerInfo[para1][pChar] = 113; } //Corleone
                        else if(level == 6) { PlayerInfo[para1][pChar] = 270; } //Barzini
                        else if(level == 7) { PlayerInfo[para1][pChar] = 186; } //Mayor
                        else if(level == 8) { PlayerInfo[para1][pChar] = 294; } //Hitmans
                        else if(level == 9) { PlayerInfo[para1][pChar] = 227; } //News Reporters
                        else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company
                        else if(level == 11) { PlayerInfo[para1][pChar] = 171; } //Driving/Flying School
                        else if(level == 12) { PlayerInfo[para1][pChar] = 184; } //The Nang Boys
                        else if(level == 13) { PlayerInfo[para1][pChar] = 24; } //Underground Street Tunning
                        else if(level == 14) { PlayerInfo[para1][pChar] = 104; } //Ballas
                        else if(level == 15) { PlayerInfo[para1][pChar] = 271; } //Grove
                        else if(level == 16) { PlayerInfo[para1][pChar] = 110; } //Los Santos Vagos
                        else if(level == 17) { PlayerInfo[para1][pChar] = 50; } //Tow Car Comapny
                        gTeam[para1] = 17;
                        PlayerInfo[para1][pTeam] = 17;
                        SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
                        GetPlayerName(playerid, numewarning, sizeof(numewarning));
                        format(string, sizeof(string), "[AdmWarning]: %s ia dat leader[%d] lui %s.",numewarning,level,giveplayer);
                        ABroadCast(COLOR_LIGHTRED,string, 5);
                    }
                }//not connected
            }
            else
            {
                SCM(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }

btw i just tested ingame with /setteam 2 (1 being civ,2 being cop) and everything works fine ,ticket gov and suspect getting killed i get the money and he goes to jail .

it looks like in the makeleader command there aint anything about setting the team,should i add it like the invite command ?


thx for your help
Reply


Messages In This Thread
you are not a cop error & suspect killed - by rekatluos - 09.08.2011, 10:33
Re: you are not a cop error & suspect killed - by Jack Shred - 09.08.2011, 10:42
Re: you are not a cop error & suspect killed - by rekatluos - 09.08.2011, 10:48
Re: you are not a cop error & suspect killed - by Jack Shred - 09.08.2011, 10:51
Re: you are not a cop error & suspect killed - by Joey Tucker - 09.08.2011, 10:52
Re: you are not a cop error & suspect killed - by Joey Tucker - 09.08.2011, 10:57
Re: you are not a cop error & suspect killed - by rekatluos - 09.08.2011, 11:08

Forum Jump:


Users browsing this thread: 1 Guest(s)