das mit 999999 kannst du aber auch direkt weglassen, geht genauso gut un hast ne zeile weniger
if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
{
if(IsPlayerConnected(playerid) && IsPlayerAdmin(playerid)) //Oder Anstatt IsPlayerAdmin einfach PlayerInfo[playerid][level oda wie das bei dir heißt] == "Den level den ein admin hat")
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "HILFE: (/w)hisper [playerid/PartOfName] [whisper text]");
return 1;
}
giveplayerid = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "HILFE: (/w)isper [playerid/PartOfName] [whisper text]");
return 1;
}
if(HidePM[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Spieler blockt Whisper!");
return 1;
}
if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 9999999999999)
{
printf("%s", string);
format(string, sizeof(string), "%s(ID: %d) whispert: %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Whisper zu %s(ID: %d).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht beim Spieler");
return 1;
}
}
}
}