Auto Jail - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Auto Jail (
/showthread.php?tid=366678)
Auto Jail -
CROSS_Hunter - 07.08.2012
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 ++
Re: Auto Jail -
CROSS_Hunter - 07.08.2012
bump!! help plzzzz
Re: Auto Jail -
electrux - 07.08.2012
remove all && they are not needed in if command in this case
Re: Auto Jail -
CROSS_Hunter - 07.08.2012
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
Re: Auto Jail -
shitbird - 07.08.2012
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?
Re: Auto Jail -
CROSS_Hunter - 07.08.2012
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 ++