Auto Jail
#1

i have made an auto jail for noob cops that keep on killing innocents so when they kill an innocent they automatically go to jail but the problem is that when i am a cop and i kill an innocent i go to jail [thats norrmal] but when i m a normal civilian and i get killed by a cop i am the one who goes to jail as if the whole auto jail thing is made on me :S

code is :

Код:
if(gTeam[killerid] == TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA)
		{
		new ID;
		    if(GetPlayerWantedLevel(playerid) < 2)
		    {
		        SendClientMessage(killerid,COLOR_RED,"[INNOCENT KILL] Do not kill innocent players .. (White/Yellow) Only shoot at Oranges and reds.");
				SendClientMessage(killerid,COLOR_RED,". Please read our /rules and our /pc for a list of player colours.");
                format(string,sizeof(string),"{33CCFF}[AUTO JAIL] {FFFFFF}%s(%d) has been sent to jail for 200 seconds {00FF00}[REASON: Killing Innocents]",PlayerName(ID),ID);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);

		TextDrawShowForPlayer(ID,JailTimer[ID]);
		ResetPlayerWeapons(ID);
		
		new rnd = random(sizeof(JailSpawnPoints));

			JailTime[ID] =200;
		    IsCuffed[ID] =0;
		    CuffTime[ID] =0;
		    TotalJailTime[ID] =200;
		    SetPlayerInterior(ID,10);
		    SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
		    SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
		    TogglePlayerControllable(ID,1);
		    StopLoopingAnim(ID);
		    SetPlayerWantedLevel(ID,0);
		    SetPlayerToTeamColour(ID);
                
				SetPlayerWantedLevel(playerid,0);
                SendDeathMessage(killerid,playerid,reason);
                
                
                return 1;
			}
help = rep ++
Reply
#2

bump!! help plzzzz
Reply
#3

remove all && they are not needed in if command in this case
Reply
#4

Quote:
Originally Posted by electrux
Посмотреть сообщение
remove all && they are not needed in if command in this case
what do u mean? its not a command its if he kills an innocent he directly goes to jail no one jails him and things its auto jail
Reply
#5

pawn Код:
if(gTeam[killerid] == TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA)
{
    if (GetPlayerWantedLevel(playerid) < 2)
    {
        SendClientMessage(killerid,COLOR_RED,"[INNOCENT KILL] Do not kill innocent players .. (White/Yellow) Only shoot at Oranges and reds.");
        SendClientMessage(killerid,COLOR_RED,". Please read our /rules and our /pc for a list of player colours.");

        format(string,sizeof(string),"{33CCFF}[AUTO JAIL] {FFFFFF}%s(%d) has been sent to jail for 200 seconds {00FF00}[REASON: Killing Innocents]",PlayerName(killerid), killerid);
        SendClientMessageToAll(COLOR_DODGERBLUE, string);
       
        TextDrawShowForPlayer(killerid, JailTimer[killerid]);
        ResetPlayerWeapons(killerid);
       
        new
            rnd = random(sizeof(JailSpawnPoints));
           
        JailTime[killerid] = 200;
        IsCuffed[killerid] = 0;
        CuffTime[killerid] = 0;
        TotalJailTime[killerid] = 200;
   
        SetPlayerInterior(killerid, 10);
        SetPlayerPos(killerid, JailSpawnPoints[rnd][0], JailSpawnPoints[rnd][1], JailSpawnPoints[rnd][2]);
        SetPlayerFacingAngle(killerid, JailSpawnPoints[rnd][3]);
   
        TogglePlayerControllable(killerid, 1);
        StopLoopingAnim(killerid);
   
        SetPlayerWantedLevel(killerid, 0);
        SetPlayerToTeamColour(killerid);
   
        SetPlayerWantedLevel(playerid, 0);
        SendDeathMessage(killerid,playerid,reason);
    }
    return 1;
}
What made you create the "ID" variable?
Reply
#6

Quote:
Originally Posted by shitbird
Посмотреть сообщение
pawn Код:
if(gTeam[killerid] == TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA)
{
    if (GetPlayerWantedLevel(playerid) < 2)
    {
        SendClientMessage(killerid,COLOR_RED,"[INNOCENT KILL] Do not kill innocent players .. (White/Yellow) Only shoot at Oranges and reds.");
        SendClientMessage(killerid,COLOR_RED,". Please read our /rules and our /pc for a list of player colours.");

        format(string,sizeof(string),"{33CCFF}[AUTO JAIL] {FFFFFF}%s(%d) has been sent to jail for 200 seconds {00FF00}[REASON: Killing Innocents]",PlayerName(killerid), killerid);
        SendClientMessageToAll(COLOR_DODGERBLUE, string);
       
        TextDrawShowForPlayer(killerid, JailTimer[killerid]);
        ResetPlayerWeapons(killerid);
       
        new
            rnd = random(sizeof(JailSpawnPoints));
           
        JailTime[killerid] = 200;
        IsCuffed[killerid] = 0;
        CuffTime[killerid] = 0;
        TotalJailTime[killerid] = 200;
   
        SetPlayerInterior(killerid, 10);
        SetPlayerPos(killerid, JailSpawnPoints[rnd][0], JailSpawnPoints[rnd][1], JailSpawnPoints[rnd][2]);
        SetPlayerFacingAngle(killerid, JailSpawnPoints[rnd][3]);
   
        TogglePlayerControllable(killerid, 1);
        StopLoopingAnim(killerid);
   
        SetPlayerWantedLevel(killerid, 0);
        SetPlayerToTeamColour(killerid);
   
        SetPlayerWantedLevel(playerid, 0);
        SendDeathMessage(killerid,playerid,reason);
    }
    return 1;
}
What made you create the "ID" variable?
THANKS ALOT !! REP ++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)