pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /cuff [id/name]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_CRVENA, "Du kannst einen Polizisten keine Handschellen anlegen!");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_CRVENA, "Du kannst dir selber die Handschellen nicht anlegen!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s legt der Person %s Handschellen an.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~VERHAFTET", 2500, 3);
SendClientMessage(giveplayerid, COLOR_PLAVA, "Alles was Sie sagen kann und wird gegen Sie verwendet werden");
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
TogglePlayerControllable(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 2;
PlayerCuffedTime[giveplayerid] = 9999;
}
else
{
SendClientMessage(playerid, COLOR_CRVENA, "Diese Person ist nicht in deiner Nдhe!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_CRVENA, "Es gibt keinen Spieler mit dieser ID!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist kein Polizist !");
}
}
return 1;
}