Scriptwunsch /do Befehl

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
  • Hallo ..


    Ich brauche dringend hilfe bin so gut wie neu am Scripten und weiß nicht wie ich das manchen soll ... deshalb poste ich mal hier einen Scriptwusch rein..


    Ich hätte gerne /whisper umgeändert ... und zwar so das mann /w überall machen kann nur für Admin und das die Admins sehen was er grade zu ihm schreibt mit /do /w soll nicht /w sondern /do dann


    Währe nett wenn ihr das umsetzen würdet


    if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)isper [playerid/PartOfName] [whisper text]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(HidePM[giveplayerid] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " That player is blocking Whispers !");
    return 1;
    }
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    if(giveplayerid == playerid)
    {
    format(string, sizeof(string), "* %s mutters somthing.", 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/PartOfName] [whisper text]");
    return 1;
    }
    format(string, sizeof(string), "%s(ID: %d) whispers: %s", sendername, playerid, (result));
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "Wisper sent to %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 is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }

  • Er will das /(w)hisper nur Admins machen können

  • if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)isper [playerid/PartOfName] [whisper text]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin]>= 1)
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(HidePM[giveplayerid] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " That player is blocking Whispers !");
    return 1;
    }
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    if(giveplayerid == playerid)
    {
    format(string, sizeof(string), "* %s mutters somthing.", 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/PartOfName] [whisper text]");
    return 1;
    }
    format(string, sizeof(string), "%s(ID: %d) whispers: %s", sendername, playerid, (result));
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "Wisper sent to %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 is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }


    Ich glaube es ist so richtig.. ;)