Hallo erstmal ich habe eine bitte an die guten Scripter. Kann mir jemand diesen /grab Befehl so umschreiben dass Fraktion 1 , 2 , 3 und 12 ihn beutzen kann ich bedanke mich schonmal im vorraus MFG Mert47
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 || IsACop(playerid))
{
new person;
person = strval(tmp);
if(IsPlayerConnected(person))
{
if(person != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,person) <= 8)
{
if(gTeam[person] == 2)
{
SendClientMessage(playerid, COLOR_GREY, " Du kannst keinen Cop / FBI / Soldaten 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 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] = 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 if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
{
if(PlayerInfo[playerid][pRank] < 4)
{
SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 4 oder höher! !");
return 1;
}
new person;
person = strval(tmp);
if(IsPlayerConnected(person))
{
if(person != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,person) <= 8)
{
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 playerVehicle = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(person, playerVehicle, 3);
GetPlayerName(person, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest in ein Farzeug gezogen.", sendername);
SendClientMessage(person, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast %s ins Fahrzeug gezogen.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GameTextForPlayer(giveplayerid, "~r~gefesselt", 2500, 3);
TogglePlayerControllable(person, 0);
PlayerCuffed[person] = 2;
PlayerCuffedTime[person] = 240;
}
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 / FBI / Soldat / Mafiosi!");
}
}
return 1;
}
if(strcmp(cmd, "/ungrab", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /ungrab [ID]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selbst ungrabben!"); return 1; }
if(PlayerCuffed[giveplayerid])
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest von %s freigelassen.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast %s freigelassen.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s hat %s freigelassen.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~g~Freiheit", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
RemovePlayerFromVehicle(giveplayerid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Person hat keine Handschellen!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Spieler ist nicht bei dir!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Offline!");
return 1;
}
}
else if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
{
if(PlayerInfo[playerid][pRank] < 4)
{
SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 4 oder höher! !");
return 1;
}
new person;
person = strval(tmp);
if(IsPlayerConnected(person))
{
if(person != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,person) <= 8)
{
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 ungrabben!"); return 1; }
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
{
if(PlayerTied[giveplayerid])
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest entfesselt.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast %s entfesselt.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GameTextForPlayer(giveplayerid, "~g~Entfesselt", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
RemovePlayerFromVehicle(giveplayerid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist nicht gefesselt !");
return 1;
}
}
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 / FBI / Soldat!");
}
}//not connected
return 1;
}