/invite befehl funkt nicht.

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 Community.


    Ich habe ein riesen Problem, unzwar funktioniert mein Invite befehl nicht...Ich habe den User versprochen das bis Sonntag zu fixxen aber das buggt ganze zeit.


    Hier mal die Code:


    if(strcmp(cmd, "/invite", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /invite [Playerid/Spielername]");
    return 1;
    }
    new para1;
    new ftext[20];
    // new leader = SpielerInfo[playerid][sLeader];
    para1 = ReturnUser(tmp);
    if (SpielerInfo[playerid][sLeader] >= 1)
    {
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    if (gTeam[para1]==TEAM_GREEN && SpielerInfo[para1][sMember] == 0)
    {
    if(SpielerInfo[para1][pARG] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, "Der Spieler hat Arbeitslosengeld beantragt, er muss es zuerst Kündigen");
    SendClientMessage(playerid, COLOR_GREY, "bevor er in eine Fraktion einsteigen darf.");
    return 1;
    }
    if(SpielerInfo[playerid][sMember] == 1) { ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
    else if(SpielerInfo[playerid][sMember] == 2) { ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
    else if(SpielerInfo[playerid][sMember] == 3) { ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
    else if(SpielerInfo[playerid][sMember] == 4) { ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
    else if(SpielerInfo[playerid][sMember] == 5) { ChosenSkin[playerid] = 124; SetPlayerSkin(playerid, 124); }
    else if(SpielerInfo[playerid][sMember] == 6) { ChosenSkin[playerid] = 121; SetPlayerSkin(playerid, 121); }
    else if(SpielerInfo[playerid][sMember] == 7) { ChosenSkin[playerid] = 164; SetPlayerSkin(playerid, 164); }
    else if(SpielerInfo[playerid][sMember] == 8) { ChosenSkin[playerid] = 137; SetPlayerSkin(playerid, 137); }
    else if(SpielerInfo[playerid][sMember] == 9) { ChosenSkin[playerid] = 187; SetPlayerSkin(playerid, 187); }
    else if(SpielerInfo[playerid][sMember] == 10) { ChosenSkin[playerid] = 189; SetPlayerSkin(playerid, 189); }
    else if(SpielerInfo[playerid][sMember] == 11) { ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
    else if(SpielerInfo[playerid][sMember] == 12) { ChosenSkin[playerid] = 107; SetPlayerSkin(playerid, 107); }
    else if(SpielerInfo[playerid][sMember] == 13) { ChosenSkin[playerid] = 104; SetPlayerSkin(playerid, 104); }
    else if(SpielerInfo[playerid][sMember] == 14) { ChosenSkin[playerid] = 292; SetPlayerSkin(playerid, 292); }
    else if(SpielerInfo[playerid][sMember] == 15) { ChosenSkin[playerid] = 109; SetPlayerSkin(playerid, 109); }
    else if(SpielerInfo[playerid][sMember] == 16) { ChosenSkin[playerid] = 116; SetPlayerSkin(playerid, 116); }
    else if(SpielerInfo[playerid][sMember] == 17) { ChosenSkin[playerid] = 258; SetPlayerSkin(playerid, 258); }
    else if(SpielerInfo[playerid][sMember] == 18) { ChosenSkin[playerid] = 71; SetPlayerSkin(playerid, 71); }
    else if(SpielerInfo[playerid][sMember] == 19) { ChosenSkin[playerid] = 143; SetPlayerSkin(playerid, 143); }
    else if(SpielerInfo[playerid][sMember] == 20) { ChosenSkin[playerid] = 208; SetPlayerSkin(playerid, 208); }
    else if(SpielerInfo[playerid][sMember] == 21) { ChosenSkin[playerid] = 254; SetPlayerSkin(playerid, 254); }
    else if(SpielerInfo[playerid][sMember] == 22) { ChosenSkin[playerid] = 244; SetPlayerSkin(playerid, 244); }
    else { return 1; }
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    SpielerInfo[para1][sMember] = SpielerInfo[playerid][sLeader];
    SpielerInfo[para1][pRank] = 1;
    printf("AdmCmd: %s hat %s eingeladen um %s beizutreten.", sendername, giveplayer, ftext);
    format(string, sizeof(string), "Du bist %s beigetreten, du wurdest vom Leader %s eingeladen", ftext, sendername);
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Du hast %s eingeladen %s beizutreten.", giveplayer,ftext);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SetPlayerInterior(para1,0);
    new rand = random(sizeof(gInviteSpawns));
    SetPlayerPos(para1, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
    SetPlayerFacingAngle(para1, gInviteSpawns[rand][3]);
    SetPlayerCameraPos(para1,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
    SetPlayerCameraLookAt(para1,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
    TogglePlayerControllable(para1, 0);
    SelectChar[para1] = 255;
    SelectCharID[para1] = SpielerInfo[para1][sMember];
    SelectCharPlace[para1] = 1;
    SpielerInfo[para1][pModel] = ChosenSkin[para1];
    SpielerInfo[para1][pChar] = ChosenSkin[para1];
    SendClientMessage(para1, COLOR_LIGHTRED, "* Verwende 'weiter' um deinen Charakter zu wählen.");
    SendClientMessage(para1, COLOR_LIGHTRED, "* Wenn du den Charakter gefunden hast, den du benutzen willst, tippe 'fertig'.");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Dieser Spieler ist bereits in ein Fraktions Mitglied");
    return 1;
    }
    }
    }//not connected
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du darfst dieses befehl nicht benutzen!");
    }
    }
    return 1;
    }



    wen man /invite macht kommt zwar eine Nachricht " Verwendung: /invite [Playerid/Spielername] " aber wen ich /invite + Spielerid eingebe dan passiert nix der spieler wird nicht invitet kann mir bitte jemand helfen.


    Danke im Vorraus.

  • if(strcmp(cmd, "/invite", true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /invite [playerid/Name]");
    return 1;
    }
    new leader = SpilerInfo[playerid][pLeader];
    new para1 = ReturnUser(tmp);
    if (SpilerInfo[playerid][pLeader] >= 1)
    {
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    if (gTeam[para1]==TEAM_GREEN && SpilerInfo[para1][pMember] == 0 && SpilerInfo[para1][pFMember] == 255)
    {
    if(SpilerInfo[para1][pFrakSperre] == 0)
    {
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    printf("AdmCmd: %s hat %s in die Fraktion %s eingeladen.", sendername, giveplayer,Fracs[leader-1]);
    format(string, sizeof(string), " Du wurdest in die Fraktion %s von Leader %s eingeladen.",Fracs[leader-1], sendername);
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    SendClientMessage(para1, COLOR_GRAD2, " Um die Einladung anzunehmen: /einladung annehmen");
    //SendClientMessage(para1, COLOR_GRAD2, " Um die Einladung abzulehnen: /einladung ablehnen");
    format(string, sizeof(string), " Du hast %s in die Fraktion %s eingeladen.", giveplayer,Fracs[leader-1]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SendClientMessage(playerid, COLOR_GRAD2, " Der Spieler muss nun deine Einladung annehmen oder ablehnen.");
    new iyear, imonth,iday;
    getdate(iyear, imonth, iday);
    format(string, sizeof(string), "%s[Level:%d] wurde von %s in die Fraktion %s eingeladen (%d-%d-%d)", giveplayer,SpilerInfo[para1][pLevel],sendername,Fracs[leader-1],imonth,iday,iyear);
    MemberLog(string);
    Eingeladen[para1] = leader;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler hat eine Fraktions-Sperre");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist in einer anderen Fraktion oder bereits ein Fraktionsmitglied.");
    return 1;
    }
    }
    }//not connected
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Nur der Leader kann diesen Befehl nutzen!");
    }
    return 1;
    }


    Annehmen/Ablehnen
    if(strcmp(cmd,"/einladung",true) == 0)
    {
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZUNG: /einladung [annehmen/ablehnen]");
    return 1;
    }
    if(Eingeladen[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du wurdest in keine Fraktion eingeladen!");
    return 1;
    }
    if(strcmp(tmp,"annehmen",true) == 0)
    {
    if(Eingeladen[playerid] == 1) { SpilerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
    else if(Eingeladen[playerid] == 2) { SpilerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
    else if(Eingeladen[playerid] == 3) { SpilerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
    else if(Eingeladen[playerid] == 4) { SpilerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
    else if(Eingeladen[playerid] == 5) { SpilerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 258; SetPlayerSkin(playerid, 120); }
    else if(Eingeladen[playerid] == 6) { SpilerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 294; SetPlayerSkin(playerid, 294); }
    else if(Eingeladen[playerid] == 7) { SpilerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ChosenSkin[playerid] = 164; SetPlayerSkin(playerid, 164); }
    else if(Eingeladen[playerid] == 8) { SpilerInfo[playerid][pTeam] = 8; gTeam[playerid] = 8; ChosenSkin[playerid] = 250; SetPlayerSkin(playerid, 250); }
    else if(Eingeladen[playerid] == 9) { SpilerInfo[playerid][pTeam] = 9; gTeam[playerid] = 9; ChosenSkin[playerid] = 187; SetPlayerSkin(playerid, 187); }
    else if(Eingeladen[playerid] == 10) { SpilerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
    else if(Eingeladen[playerid] == 11) { SpilerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; ChosenSkin[playerid] = 240; SetPlayerSkin(playerid, 240); }
    else if(Eingeladen[playerid] == 12) { SpilerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 118; SetPlayerSkin(playerid, 118); }//Fuegos
    else if(Eingeladen[playerid] == 13) { SpilerInfo[playerid][pTeam] = 13; gTeam[playerid] = 13; ChosenSkin[playerid] = 105; SetPlayerSkin(playerid, 105); }//Grove
    else if(Eingeladen[playerid] == 14) { SpilerInfo[playerid][pTeam] = 14; gTeam[playerid] = 14; ChosenSkin[playerid] = 102; SetPlayerSkin(playerid, 102); }//Ballas
    else if(Eingeladen[playerid] == 15) { SpilerInfo[playerid][pTeam] = 15; gTeam[playerid] = 15; ChosenSkin[playerid] = 185; SetPlayerSkin(playerid, 185); }//Sf Biker Club
    else if(Eingeladen[playerid] == 16) { SpilerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; ChosenSkin[playerid] = 108; SetPlayerSkin(playerid, 108); }//Los Santos Vagos
    else if(Eingeladen[playerid] == 17) { SpilerInfo[playerid][pTeam] = 17; gTeam[playerid] = 17; ChosenSkin[playerid] = 114; SetPlayerSkin(playerid, 114); }//Varios Los Aztecas
    else if(Eingeladen[playerid] == 18) { SpilerInfo[playerid][pTeam] = 18; gTeam[playerid] = 18; ChosenSkin[playerid] = 173; SetPlayerSkin(playerid, 173); }//Los Santos Rifa
    else if(Eingeladen[playerid] == 19) { SpilerInfo[playerid][pTeam] = 19; gTeam[playerid] = 19; ChosenSkin[playerid] = 234; SetPlayerSkin(playerid, 234); }//West Coust Customs
    else if(Eingeladen[playerid] == 20) { SpilerInfo[playerid][pTeam] = 20; gTeam[playerid] = 20; ChosenSkin[playerid] = 220; SetPlayerSkin(playerid, 220); }
    else if(Eingeladen[playerid] == 21) { SpilerInfo[playerid][pTeam] = 21; gTeam[playerid] = 21; ChosenSkin[playerid] = 28; SetPlayerSkin(playerid, 28); } else if(Eingeladen[playerid] == 22) { SpilerInfo[playerid][pTeam] = 22; gTeam[playerid] = 22; ChosenSkin[playerid] = 274; SetPlayerSkin(playerid, 274); }
    else if(Eingeladen[playerid] == 23) { SpilerInfo[playerid][pTeam] = 23; gTeam[playerid] = 23; ChosenSkin[playerid] = 133; SetPlayerSkin(playerid, 133); }
    else if(Eingeladen[playerid] == 24) { SpilerInfo[playerid][pTeam] = 24; gTeam[playerid] = 24; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
    else { return 1; }
    GetPlayerName(playerid,sendername,sizeof(sendername));
    SpilerInfo[playerid][pMember] = Eingeladen[playerid];
    SpilerInfo[playerid][pRank] = 1;
    format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s angenommen!",sendername,Fracs[Eingeladen[playerid]-1]);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(SpilerInfo[i][pLeader] == Eingeladen[playerid])
    {
    SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    }
    }
    SetPlayerInterior(playerid,0);
    new rand = random(sizeof(gInviteSpawns));
    SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
    SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
    SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
    SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
    FreezePlayer(playerid);
    SelectChar[playerid] = 255;
    Eingeladen[playerid] = 0;
    SelectCharID[playerid] = SpilerInfo[playerid][pMember];
    SelectCharPlace[playerid] = 1;
    SpilerInfo[playerid][pModel] = ChosenSkin[playerid];
    SpilerInfo[playerid][pChar] = ChosenSkin[playerid];
    SendClientMessage(playerid, COLOR_GRAD5, " Du kannst mit /help deine neuen Fraktionsbefehle betrachten");
    SendClientMessage(playerid, COLOR_LIGHTRED, "* Benutze 'weiter' um dir den Charakter auszusuchen den du gerne benutzen möchtest.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "* Wenn du den richtigen gefunden hast, gib 'fertig' ein.");
    }
    else if(strcmp(tmp,"ablehnen",true) == 0)
    {
    format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s abgelehnt!",sendername,Fracs[Eingeladen[playerid]-1]);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(SpilerInfo[i][pLeader] == Eingeladen[playerid])
    {
    SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    }
    }
    Eingeladen[playerid] = 0;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /einladung [annehmen/ablehnen]");
    }
    return 1;
    }

    German Projekt Reallife

    87.98.244.35:3434