Hallo leute
eine frage unszwar:
/whisper soll nur für admins möglich sein!
Also erst ab Moderator....
Sprich spieler mit Rank: 0 sollen es nicht können...
Nur rank: 1, 2, 3, 4, 5, 1337 & 1338 sollens können!
//----------------------------------[Wisper]-----------------------------------------------
if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
{
if(IsPlayerConnected(playerid))
{
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;
}
}
}
}
Hier so ists zurzeit