/whisper (/w) geht nicht o_O

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • /*if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pSupporter] >= 1)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "NUTZUNG: (/w)isper [playerid/PartOfName] [text]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    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[100];
    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, "NUTZUNG: (/w)isper [playerid/PartOfName] [text]");
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(string,sizeof(string),"%d Admin %s(%d) sagt dir: %s",PlayerInfo[playerid][pAdmin],sendername,playerid,result);
    }
    else if(PlayerInfo[playerid][pSupporter] >= 1)
    {
    format(string,sizeof(string),"%d Supporter %s(%d) sagt dir: %s",PlayerInfo[playerid][pSupporter],sendername,playerid,result);
    }
    format(string, sizeof(string), "Du sagts %s(%d):%s",giveplayer,giveplayerid,result);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_GRAD1," Der Spieler ist offline!");
    }
    }
    return 1;
    }*/

    Wo liegt hier der Fehler? ^^

  • ist das genau so in deinem Script drinnen?


    EDIT: Wenn ja dann versuch es ma so
    if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pSupporter] >= 1)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "NUTZUNG: (/w)isper [playerid/PartOfName] [text]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    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[100];
    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, "NUTZUNG: (/w)isper [playerid/PartOfName] [text]");
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(string,sizeof(string),"%d Admin %s(%d) sagt dir: %s",PlayerInfo[playerid][pAdmin],sendername,playerid,result);
    }
    else if(PlayerInfo[playerid][pSupporter] >= 1)
    {
    format(string,sizeof(string),"%d Supporter %s(%d) sagt dir: %s",PlayerInfo[playerid][pSupporter],sendername,playerid,result);
    }
    format(string, sizeof(string), "Du sagts %s(%d):%s",giveplayer,giveplayerid,result);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_GRAD1," Der Spieler ist offline!");
    }
    }
    return 1;
    }