Hey leute,
Was ist an diesem Befehl falsch, wenn ich /grab mache passiert nichts oder die Meldung kommt dass ich in diesem auto den befehl nicht machen kann obwohl ich aber im richtigen sitze ?
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(gTeam[playerid] == 2 || PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14 || IsAZoll(playerid))
{
new person;
person = strval(tmp);
if(IsPlayerConnected(person))
{
if(person != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,person) <= 10)
{
if(gTeam[person] == 2 || PlayerInfo[person][pMember] == 14 || PlayerInfo[person][pLeader] == 14 || IsAZoll(person))
{
SendClientMessage(playerid, COLOR_GREY, " Du kannst keinen Beamten 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;
}
new carid = GetPlayerVehicleID(playerid);
if(!IsACopCar(carid) || !IsAZollCar(carid) || GetVehicleModel(carid) == 528)//528 ist das fbi gepanzerte
{
SendClientMessage(playerid, COLOR_GREY, "Du kannst in dieses Fahrzeug niemanden grabben");
return 1;
}
else if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && GetPlayerVehicleID(playerid) == 599)
{
if(beifahrer[playerid] == 0)
{
new playerVehicle = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(person, playerVehicle, 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);
TogglePlayerControllable(person, 0);
PlayerCuffed[person] = 2;
PlayerCuffedTime[person] = 240;//4 min
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du kannst niemanden grabben, da du einen Beifahrer hast");
}
}
else if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
{
new playerVehicle = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(person, playerVehicle, 3);
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);
TogglePlayerControllable(person, 0);
PlayerCuffed[person] = 2;
PlayerCuffedTime[person] = 240;//4 min
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du fährst kein Auto!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Spieler ist nicht in deiner Nähe!");
return 1;
}
}
}
}
}
return 1;
}