Hallo leute, ich habe problem. Wenn ich Bust per taste dann buste ich nit Den Bösen Busten will dann buste ich mich selber und unbust den Gefangenen.
Hir der Cod von Bust:
if(newkeys == KEY_LOOK_BEHIND)
{
if((PlayerInfo[playerid][pPolizei] == POLIZEI && PlayerInfo[playerid][pDuty] == 1) || (PlayerInfo[playerid][pSwat] == 1 && PlayerInfo[playerid][pDuty] == 1))
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(GetDistanceBetweenPlayers(playerid, i) < 3 && i != playerid) //Distance of 5 in-game meters
{
if(i == playerid) return 1;
if(PlayerInfo[i][pBusted] == 0)
{
TogglePlayerControllable(i, false);
new weaponslist;
new ammo;
GetPlayerWeaponData(i, 1, weaponslist, ammo);
if(ammo >= 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "Hatte Waffen!");
}
ResetPlayerWeapons(i);
PlayerInfo[i][pBusted] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "Spieler festgenommen!");
SendClientMessage(i, COLOR_YELLOW, "Du wurdest festgenommen!");
for(new c=0; c<MAX_PLAYERS; c++)
{
new copstring[256];
new tater[MAX_PLAYER_NAME];
new cop[MAX_PLAYER_NAME];
GetPlayerName(i, tater, sizeof(tater));
GetPlayerName(playerid, cop, sizeof(cop));
if(PlayerInfo[code=c][pPolizei] == POLIZEI && PlayerInfo[code=c][pDuty] == 1)
{
if(GetPlayerSkin(c) == 280 || GetPlayerSkin(c) == 283)
{
format(copstring, sizeof(copstring), "%s hat %s festgenommen.",cop, tater);
SendClientMessage(c, COLOR_YELLOW, copstring);
}
}
}
}
else if(PlayerInfo[i][pBusted] == 1)
{
TogglePlayerControllable(i, true);
SendClientMessage(playerid, COLOR_YELLOW, "Spieler ungebusted!");
SendClientMessage(i, COLOR_YELLOW, "Du wurdest ungebusted!");
new cop[MAX_PLAYER_NAME];
new tater[MAX_PLAYER_NAME];
new string[256];
for(new p = 0; p < MAX_PLAYERS; p++)
{
GetPlayerName(playerid, cop, sizeof(cop));
GetPlayerName(p, tater, sizeof(tater));
if(PlayerInfo[p][pPolizei] == POLIZEI && PlayerInfo[p][pDuty] == 1)
{
if(GetPlayerSkin(p) == 280 || GetPlayerSkin(p) == 283)
{
format(string, sizeof(string), "%s hat %s die Handschellen abgenommen!", cop, tater);
SendClientMessage(p, COLOR_YELLOW, string);
}
}
}
PlayerInfo[i][pBusted] = 0;
}
}
}
}
}
//edit
Kann keiner helfen?