if(strcmp(cmd, "/robperson", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Benutzung: /robperson [Playerid/Name]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GREY, "Der Befehl ist in dieser Lage nicht erlaubt.");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
new robcash;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
robcash = GetPlayerMoney(giveplayerid);
ConsumingMoney[giveplayerid] = 1;
GivePlayerMoney(playerid, (robcash/10));
GivePlayerMoney(giveplayerid, -robcash/10);
format(string, sizeof(string), "Du hast %s(%d) $%d gestohlen.", giveplayer,giveplayerid, robcash);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GREY, string);
format(string, sizeof(string), "%s(%d) hat dir $%d gestohlen.", sendername, playerid, robcash);
SendClientMessage(giveplayerid, COLOR_GREY, string);
format(string, sizeof(string), "", sendername, moneys, giveplayer);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s hat %s ausgeraubt.", sendername ,giveplayer);
ProxDetector(15.0, playerid, string, COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist nicht nah genug bei dir!");
}
}
}
else
{
format(string, sizeof(string), "%d ist kein aktiver Spieler!", giveplayerid);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
return 1;
}
Ich schaff das irgendwie nicht, dass 10% vom Bargeld des Opfers abgezogen werden und der Räuber die 10% dann kriegt...