Hey,
Also das Knastsystem ist Verbuggt.
Was Passiert?
Wenn mich ein Cop Verhaftet lande ich im Knast, aber ich komme nicht mehr raus ...
Wenn ich relogge bin ich auch aus dem Knast drausen!
Help :o
Code /arrest :
if(strcmp(cmd, "/arrest", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, BLAU, "FEHLER: /arrest [ID/Name]");
return 1;
}
new giveplayerid, string[128];
giveplayerid = ReturnUser(tmp);
if(Spieler[playerid][Team] == 1 || Spieler[playerid][Team] == 2 || Spieler[playerid][Team] == 14 || Spieler[playerid][Team] == 15)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(Spieler[giveplayerid][Team] != 1 || Spieler[giveplayerid][Team] != 2)
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, 255.6112,85.3952,1002.4453) || IsPlayerInRangeOfPoint(playerid, 10.0,1565.2869,-1695.0863,5.8906))
{
if(IsPlayerInRangeOfPoint(giveplayerid, 30.0, 255.6112,85.3952,1002.4453) || IsPlayerInRangeOfPoint(giveplayerid, 10.0,1565.2869,-1695.0863,5.8906))
{
if(Spieler[giveplayerid][Wanteds] > 0)
{
new jailt = 0 +random(2);
Spieler[giveplayerid][JailType] = jailt;
Spieler[giveplayerid][Jailed] = 1;
Spieler[playerid][JailTime] = 3*Spieler[playerid][Wanteds];
new moneyss = Spieler[giveplayerid][Wanteds]*2000;
GivePlayerCash(giveplayerid, -moneyss);
GivePlayerCash(playerid, moneyss);
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, BLAU, "FEHLER: /arrest [ID/Name]");
return 1;
}
new giveplayerid, string[128];
giveplayerid = ReturnUser(tmp);
if(Spieler[playerid][Team] == 1 || Spieler[playerid][Team] == 2 || Spieler[playerid][Team] == 14 || Spieler[playerid][Team] == 15)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(Spieler[giveplayerid][Team] != 1 || Spieler[giveplayerid][Team] != 2)
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, 255.6112,85.3952,1002.4453) || IsPlayerInRangeOfPoint(playerid, 10.0,1565.2869,-1695.0863,5.8906))
{
if(IsPlayerInRangeOfPoint(giveplayerid, 30.0, 255.6112,85.3952,1002.4453) || IsPlayerInRangeOfPoint(giveplayerid, 10.0,1565.2869,-1695.0863,5.8906))
{
if(Spieler[giveplayerid][Wanteds] > 0)
{
new jailt = 0 +random(2);
Spieler[giveplayerid][JailType] = jailt;
Spieler[giveplayerid][Jailed] = 1;
Spieler[playerid][JailTime] = 3*Spieler[playerid][Wanteds];
new moneyss = Spieler[giveplayerid][Wanteds]*2000;
GivePlayerCash(giveplayerid, -moneyss);
GivePlayerCash(playerid, moneyss);
if(Spieler[playerid][Team] == 1)
{
format(string, sizeof(string), "<< Officer %s hat den Verbrecher %s eingesperrt >>", SpielerName(playerid), SpielerName(giveplayerid));
}
else if(Spieler[playerid][Team] == 2)
{
format(string, sizeof(string), "<< Agent %s hat den Verbrecher %s eingesperrt >>", SpielerName(playerid), SpielerName(giveplayerid));
}
SendClientMessageToAll(COLOR_RED, string);
//SpawnPlayer(giveplayerid);
knasttimer[playerid] = SetTimerEx("KnastJail", 10, 0, "%i", playerid);
SetPlayerPos(giveplayerid, 263.6662,82.3516,1001.0391);
SetPlayerInterior(giveplayerid, 6);
format(string, sizeof(string), "Du bist nun für 4 Minuten im Knast. Das Töten im Knast ist verboten.");
SendClientMessage(giveplayerid, COLOR_RED, string);
SetPVarInt(giveplayerid,"Wanted",0);
Spieler[giveplayerid][Wanteds] = 0;
SetPlayerWantedLevel(giveplayerid,0);
SetPlayerHealth(playerid,80);
}
}
else
{
SendClientMessage(playerid, ROT, "Der Spieler ist nicht in der Nähe des Arrest-Points.");
return 1;
}
}
else
{
SendClientMessage(playerid, ROT, "Du bist nicht in der Nähe des Arrest-Points.");
return 1;
}
}
else
{
SendClientMessage(playerid, ROT, "Der Spieler ist ein Beamter!");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, ROT, "Du bist kein Beamter.");
return 1;
}
}
return 1;
}
{
format(string, sizeof(string), "<< Officer %s hat den Verbrecher %s eingesperrt >>", SpielerName(playerid), SpielerName(giveplayerid));
}
else if(Spieler[playerid][Team] == 2)
{
format(string, sizeof(string), "<< Agent %s hat den Verbrecher %s eingesperrt >>", SpielerName(playerid), SpielerName(giveplayerid));
}
SendClientMessageToAll(COLOR_RED, string);
//SpawnPlayer(giveplayerid);
knasttimer[playerid] = SetTimerEx("KnastJail", 10, 0, "%i", playerid);
SetPlayerPos(giveplayerid, 263.6662,82.3516,1001.0391);
SetPlayerInterior(giveplayerid, 6);
format(string, sizeof(string), "Du bist nun für 4 Minuten im Knast. Das Töten im Knast ist verboten.");
SendClientMessage(giveplayerid, COLOR_RED, string);
SetPVarInt(giveplayerid,"Wanted",0);
Spieler[giveplayerid][Wanteds] = 0;
SetPlayerWantedLevel(giveplayerid,0);
SetPlayerHealth(playerid,80);
}
}
else
{
SendClientMessage(playerid, ROT, "Der Spieler ist nicht in der Nähe des Arrest-Points.");
return 1;
}
}
else
{
SendClientMessage(playerid, ROT, "Du bist nicht in der Nähe des Arrest-Points.");
return 1;
}
}
else
{
SendClientMessage(playerid, ROT, "Der Spieler ist ein Beamter!");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, ROT, "Du bist kein Beamter.");
return 1;
}
}
return 1;
}
Timer :
new knasttimer[MAX_PLAYERS];
Forward :
forward KnastJail(playerid);
Public Knast :
public KnastJail(playerid)
{
if(IsPlayerConnected(playerid))
{
if(Spieler[playerid][Jailed] == 1)
{
Spieler[playerid][Jailed] = 0;
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_LIGHTRED, "Cop: Du wurdest aus dem Knast entlassen. Benimm dich!");
SpawnPlayer(playerid);
KillTimer(knasttimer[playerid]);
}
else if(Spieler[playerid][Jailed] == 0)
{
SpawnPlayer(playerid);
KillTimer(knasttimer[playerid]);
}
}
return 1;
}
{
if(IsPlayerConnected(playerid))
{
if(Spieler[playerid][Jailed] == 1)
{
Spieler[playerid][Jailed] = 0;
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_LIGHTRED, "Cop: Du wurdest aus dem Knast entlassen. Benimm dich!");
SpawnPlayer(playerid);
KillTimer(knasttimer[playerid]);
}
else if(Spieler[playerid][Jailed] == 0)
{
SpawnPlayer(playerid);
KillTimer(knasttimer[playerid]);
}
}
return 1;
}
OnPlayerDeath :
if(IsPlayerConnected(playerid))
{
if(Spieler[playerid][Team] != 1 || Spieler[playerid][Team] != 2 || Spieler[playerid][Team] != 14)
{
Spieler[playerid][Jailed] = 1;
Spieler[playerid][JailType] = 1;
jailcash = 2000*Spieler[playerid][Wanteds];
GivePlayerCash(playerid, -jailcash);
GivePlayerCash(killerid, jailcash);
SendClientMessage(playerid, COLOR_GRAD2, "");
format(string, sizeof(string), "Du bist nun im Knast.");
SetPlayerHealth(playerid,80);
SendClientMessage(playerid, COLOR_RED, string);
SetPVarInt(playerid,"Wanted",0);
SetPlayerPos(playerid, 263.6662,82.3516,1001.0391);
SetPlayerInterior(playerid, 6);
}
}
}
{
if(Spieler[playerid][Team] != 1 || Spieler[playerid][Team] != 2 || Spieler[playerid][Team] != 14)
{
Spieler[playerid][Jailed] = 1;
Spieler[playerid][JailType] = 1;
jailcash = 2000*Spieler[playerid][Wanteds];
GivePlayerCash(playerid, -jailcash);
GivePlayerCash(killerid, jailcash);
SendClientMessage(playerid, COLOR_GRAD2, "");
format(string, sizeof(string), "Du bist nun im Knast.");
SetPlayerHealth(playerid,80);
SendClientMessage(playerid, COLOR_RED, string);
SetPVarInt(playerid,"Wanted",0);
SetPlayerPos(playerid, 263.6662,82.3516,1001.0391);
SetPlayerInterior(playerid, 6);
}
}
}
Gibt keine Errors ..
Was soll ich machen
LG
Crocky