Kommt drauf an mit was du lieber arbeitest hier ein dcmd von mir und noch ein Ausschnitt aus gf
dcmd(whisper, 7, cmdtext); //Unter OnPlayerCommandText wenn du lieber mit dmcd arbeitest
dcmd_whisper(playerid, params[])
{
if (!Player[playerid][HasSpawnedYet])
{
SendClientMessage(playerid, RED, "Du Vollidiot bist noch nicht gespawnt.");
return 1;
}
if(IsSpawned[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "Du bist Tot ! Tote können reden ? Eher nicht !");
return 1;
}
if(strlen(cmdtext) <= 3) {
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /w (Nachricht)");
return 1;
}
new output[150];
new pname[24];
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,2,strlen(cmdtext));
format(string, sizeof(string), "(Flüstert): %s(%d) %s",pname,playerid,output);
printf("%s", string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10) {
{
format(string, sizeof(string), "(Flüstert): %s(%d) %s",pname,playerid,output);
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
return 1;
}
[b]Ansonsten [/b]
//----------------------------------[Wisper]-----------------------------------------------
if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du hast dich noch nicht eingeloogt !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)isper [playerid/TeildesNamens] [Flüster Text]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(HidePM[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler blockiert die Flüster Funktion !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(giveplayerid == playerid)
{
format(string, sizeof(string), "* %s flüstert etwas.", sendername);
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
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, "USAGE: (/w)isper [playerid/TeildesNamens] [Flüster Text]");
return 1;
}
format(string, sizeof(string), "%s(ID: %d) flüstert: %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
format(string, sizeof(string), "flüstert zu %s(ID: %d).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
SBizzInfo[2][sbTill] += txtcost / 2;
ExtortionSBiz(2, txtcost / 2);
return 1;
}
}
else
{
format(string, sizeof(string), " %d ist kein Aktiver Spieler.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
return 1;
}