Und zwar wird der Spielern icht reingezogen why?
if(strcmp(cmd, "/grab", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /grab [ID]");
return 1;
}
if(IsACop(playerid))
{
new person = strval(tmp);
new playerVehicle = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(person))
{
if(person != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,person) <= 8)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Du kannst nur in Fahrzeugen grabben!");
return 1;
}
if(PlayerCuffed[person] != 1)
{
SendClientMessage(playerid, COLOR_GREY, "Spieler muss getazert sein!");
return 1;
}
if(IsACop(person))
{
SendClientMessage(playerid, COLOR_GREY, "Du kannst keinen Cop grabben!");
return 1;
}
if(IsPlayerInAnyVehicle(person))
{
SendClientMessage(playerid, COLOR_GREY, "Ziel ist in einem Auto!");
return 1;
}
if(person == playerid) { SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selbst grabben!"); return 1; }
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
{
new car = GetPlayerVehicleID(playerid);
if(IsA2Turer(car))
{
SendClientMessage(playerid, COLOR_GRAD1, "Mit dem Auto kannst du keine Leute grabben!");
return 1;
}
GetPlayerName(person, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest von %s ins Farzeug gezogen.", sendername);
SendClientMessage(person, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast %s ins Fahrzeug gezogen.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s hat %s ins Fahrzeug gezogen", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Festgenommen", 2500, 3);
PutPlayerInVehicle(person,playerVehicle,3);
FreezePlayer(person);
PlayerCuffed[person] = 2;
PlayerCuffedTime[person] = (180 + random(180));
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du fährst kein Auto!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Spieler ist nicht in deine Nähe!");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Cop!");
}
}
return 1;
}