SMS PM system

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, "/sms", true) == 0 || strcmp(cmd, "/txt", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pTot] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, "Tote können nicht Reden!");
    return 0;
    }
    if(PlayerInfo[playerid][pHandyGeld] <= 0 && PlayerInfo[playerid][pHandyVer] == 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du hast nicht genug Guthaben um den Anruf zu Bezahlen !");
    SendClientMessage(playerid, COLOR_GREY, " Geh in die Stadthalle und kauf dir eine PrePaid Aufladekarte !");
    SendClientMessage(playerid, COLOR_GREY, " 30$ Guthaben Kostet = 30$ !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "(/t)ext [phonenumber] [text]");
    return 1;
    }
    if(PlayerInfo[playerid][pPnumber] == 0)
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du hast kein Handy...");
    return 1;
    }
    GetPlayerName(playerid, sendername, sizeof(sendername));
    //new handyname[20];
    if(PlayerInfo[playerid][pHandyID] == 7) { format(handyname, sizeof(handyname), "Google HTC Magic"); }
    else if(PlayerInfo[playerid][pHandyID] == 6) { format(handyname, sizeof(handyname), "iPhone"); }
    else if(PlayerInfo[playerid][pHandyID] == 5) { format(handyname, sizeof(handyname), "BlackBerry BOLD"); }
    else if(PlayerInfo[playerid][pHandyID] == 4) { format(handyname, sizeof(handyname), "Motorola Q9h"); }
    else if(PlayerInfo[playerid][pHandyID] == 3) { format(handyname, sizeof(handyname), "Sony Ericsson C905"); }
    else if(PlayerInfo[playerid][pHandyID] == 2) { format(handyname, sizeof(handyname), "Nokia N95"); }
    else if(PlayerInfo[playerid][pHandyID] == 1) { format(handyname, sizeof(handyname), "Nokia 6500"); }
    else { format(handyname, sizeof(handyname), "Nokia 3330"); }
    format(string, sizeof(string), "* %s nimmt sein %s raus.", sendername, handyname);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);


    new phonenumb = strval(tmp);
    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: (/t)ext [phonenumber] [text chat]");
    return 1;
    }
    if(phonenumb == 555)
    {
    if ((strcmp("yes", result, true, strlen(result)) == 0) && (strlen(result) == strlen("yes")))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Gesendet.");
    if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_YELLOW, "SMS: I have no idea what you're talking about, Sender: MOLE (555)");
    RingTone[playerid] = 20;
    return 1;
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_YELLOW, "SMS: A simple Yes will do, Sender: MOLE (555)");
    RingTone[playerid] = 20;
    return 1;
    }
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
    {
    giveplayerid = i;
    Mobile[playerid] = giveplayerid; //caller connecting
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(PhoneOnline[giveplayerid] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist Offline !");
    return 1;
    }
    format(string, sizeof(string), "SMS: %s, von: %s (%d)", result,sendername,PlayerInfo[playerid][pPnumber]);
    GetPlayerName(giveplayerid, sendername, sizeof(sendername));
    //format(string, sizeof(string), "* %s's phone beeps.", sendername);
    RingTone[giveplayerid] =20;
    SendClientMessage(playerid, COLOR_WHITE, "Gesendet");
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "~r~$-%d", txtcost);
    GameTextForPlayer(playerid, string, 5000, 1);
    //PlayerInfo[playerid][pHandyGeld] -= txtcost;
    if(PlayerInfo[playerid][pHandyVer] == 0) PlayerInfo[playerid][pHandyGeld] -= 1;
    SBizzInfo[2][sbTill] += 10;
    ExtortionSBiz(2, txtcost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    Mobile[playerid] = 255;
    return 1;
    }
    }
    }
    }
    }
    SendClientMessage(playerid, COLOR_GRAD2, " Senden Fehlgeschlagen...");
    }

  • if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du musst eingelogt sein!");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: (/w)isper [Spieler ID / Name] [Text]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (IsPlayerConnected(giveplayerid) && GetDistanceBetweenPlayers(playerid,giveplayerid) < 8)
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(HidePM[giveplayerid] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Der Spieler erlaubt es nicht, zu flüstern!");
    return 1;
    }
    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, "BeBenutzung: (/w)isper [playerid/Name] [Text]");
    return 1;
    }
    format(string, sizeof(string), "* %s flüstert etwas zu %s.", sendername,giveplayer);
    ProxDetector(7.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    format(string, sizeof(string), "%s(ID: %d) hat dir etwas zugeflüstert: %s", sendername, playerid, (result));
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "Du hast %s(ID: %d) folgendes zugeflüstert: %s.", giveplayer, giveplayerid, (result));
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }
    }
    else
    {
    format(string, sizeof(string), " ID %d ist nicht online / nicht in deiner Nähe!", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }