/einladen und /annehmen

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 hab heute mal ein Problem, ich kann zwar gut Scripten aber


    ich finde meinen Fehler nicht! Wenn ich jemanden auf meinem Selfmade einlade in eine Fraktion und er es


    annimmt dann passiert nichts, er kriegt nur eine Message wird aber nicht invitet!


    So ist mein Code:


    dcmd_einladen(playerid,params[])
    {
    new pID;
    if(sscanf(params,"u",pID)) return SendClientMessage(playerid,COLOR_WHITE,"Benutzung: /einladen [playerid]");
    if(SInfo[playerid][pLeader] >= 1)
    {
    new string[128];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string,sizeof(string),"Du hast Spieler %s in deine Fraktion eingeladen.",pname);
    SendClientMessage(playerid,COLOR_RED,string);
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string,sizeof(string),"Spieler %s hat dich in deine Fraktion eingeladen. Schreibe /annehmen um sie anzunehmen.",pname);
    SendClientMessage(pID,COLOR_RED,string);
    SInfo[pID][pEinladung] = SInfo[playerid][pLeader];
    SavePlayer(pID);
    }
    return 1;
    }


    dcmd_annehmen(playerid,params[])
    {
    if(SInfo[playerid][pEinladung] > 0)
    {
    SInfo[playerid][pMember] = SInfo[playerid][pEinladung];
    SInfo[playerid][pRang] = 1;
    SendClientMessage(playerid,Blau,"Du hast der Einladung zugestimmt.");
    SInfo[playerid][pEinladung] = 0;
    SpawnPlayer(playerid);
    SavePlayer(playerid);
    }
    return 1;
    }


    Hoffe mir kann einer weiterhelfen


    Mfg


    Kampfnudel

  • Hab mal nachgeschaut wenn ich mich leader mache und nur leader bin spawne ich auch nicht... So ist mein Spawncode:


    public OnPlayerSpawn(playerid)
    {
    TextDrawShowForPlayer(playerid,txtTimeDisp);
    SetPlayerTime(playerid,hour,minute);
    if(SInfo[playerid][Telefonnummer] == 0)
    {
    SInfo[playerid][Telefonnummer] = FKInfo[0][Spielernummer];
    FKInfo[0][Spielernummer] += 1;
    Frakkassenspeichern();
    SavePlayer(playerid);
    return 1;
    }
    SetPlayerSpawn(playerid);
    return 1;
    }
    forward SetPlayerSpawn(playerid);
    public SetPlayerSpawn(playerid)
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    if(SInfo[playerid][pBan] == 0)
    {


    if(SInfo[playerid][pKnastzeit] > 0)
    {
    SetPlayerPos(playerid,-2197.2017,1836.8275,7.1072); // knast
    SetPlayerInterior(playerid,3);
    SetPlayerFacingAngle(playerid, 4.0557);
    }
    if(SInfo[playerid][pGefesselt] == 1)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new string[128];
    SInfo[playerid][pKnast] = 1;
    SInfo[playerid][pKnastzeit] = SInfo[playerid][pWantedpunkte]*4;
    SetPlayerWantedLevel(playerid,0);
    SetPlayerPos(playerid,-2197.2017,1836.8275,7.1072);
    SInfo[playerid][pGefesselt] = 0;
    format(string,sizeof(string),"Du wurdest wegen Offline-Flucht eingesperrt! Zeit: %d Minute/n",SInfo[playerid][pWantedpunkte]*4);
    SendClientMessage(playerid,Gelb,string);
    format(string,sizeof(string),"[JunkBuster]Spieler %s wurde Automatisch wegen Offline-Flucht eingesperrt! Zeit: %d Minute/n",name,SInfo[playerid][pWantedpunkte]*4);
    SendAdminMessage(Gelb,string,1);
    SInfo[playerid][pWantedpunkte] = 0;
    }
    if(SInfo[playerid][pGangjail] == 1)
    {
    SendClientMessage(playerid,Gelb,"Du bist nun wieder im Gangjail! Da du eingesperrt warst...");
    SetPlayerPos(playerid,-368.4912,-1429.0795,25.7266);
    SInfo[playerid][pGefesselt] = 0;
    }
    if(SInfo[playerid][pFesseln] == 1)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new string[128];
    SendClientMessage(playerid,Gelb,"Du wurdest wegen Offline-Flucht ins Gangjail eingesperrt!");
    format(string,sizeof(string),"[JunkBuster]Spieler %s wurde Automatisch wegen Offline-Flucht ins Gangjail eingesperrt!",name);
    SendAdminMessage(Gelb,string,1);
    SInfo[playerid][pGangjail] = 1;
    SInfo[playerid][pFesseln] = 0;
    SetPlayerPos(playerid,-368.4912,-1429.0795,25.7266);
    }
    if(SInfo[playerid][pSpawnanders] == 0)
    {
    if(SInfo[playerid][pLeader] == 0 || SInfo[playerid][pMember] == 0)
    {
    SetPlayerPos(playerid,436.0735,-1749.7546,9.0871);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerColor(playerid,0xFAFAFAFF);
    SInfo[playerid][pLeader] = 0;
    SInfo[playerid][pMember] = 0;
    SInfo[playerid][pRang] = 0;
    SInfo[playerid][pLohn] = 0;
    }
    if(SInfo[playerid][pLeader] == 1 || SInfo[playerid][pMember] == 1)
    {
    SetPlayerPos(playerid,197.0630,168.4374,1003.0234); // los santos
    SetPlayerInterior(playerid,3);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerColor(playerid,0x007DFFFF);
    SetPlayerSkin(playerid,282);
    }
    if(SInfo[playerid][pLeader] == 2 || SInfo[playerid][pMember] == 2)
    {
    SetPlayerPos(playerid,212.7632,1855.2345,12.9894); // army
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,287);
    }
    if(SInfo[playerid][pLeader] == 3 || SInfo[playerid][pMember] == 3)
    {
    SetPlayerPos(playerid,1095.3982,-1241.8716,15.8203); // Fahrschule
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,171);
    }
    if(SInfo[playerid][pLeader] == 4 || SInfo[playerid][pMember] == 4)
    {
    SetPlayerPos(playerid,1267.7544,-869.1859,1085.0000);//Vagos
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,1);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,108);
    }
    if(SInfo[playerid][pLeader] == 5 || SInfo[playerid][pMember] == 5)
    {
    SetPlayerPos(playerid,1267.7544,-869.1859,1085.0000);//ballas
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,2);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,103);
    }
    if(SInfo[playerid][pLeader] == 6 || SInfo[playerid][pMember] == 6)
    {
    SetPlayerPos(playerid,1267.7544,-869.1859,1085.0000);//Grove Street
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,3);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,86);
    }
    if(SInfo[playerid][pLeader] == 7 || SInfo[playerid][pMember] == 7)
    {
    SetPlayerPos(playerid,1278.2172,-860.6755,1085.0000);//LCN
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,1);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,113);
    }
    if(SInfo[playerid][pLeader] == 8 || SInfo[playerid][pMember] == 8)
    {
    SetPlayerPos(playerid,1278.2172,-860.6755,1084.5017);//oamt
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,71);
    }
    if(SInfo[playerid][pLeader] == 9 || SInfo[playerid][pMember] == 9)
    {
    SetPlayerPos(playerid,1278.2172,-860.6755,1084.5017);//rettungsdienst
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,275);
    }
    if(SInfo[playerid][pLeader] == 10 || SInfo[playerid][pMember] == 10)
    {
    SetPlayerPos(playerid,1278.2172,-860.6755,1085.0000);//Yakuza
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,2);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,120);
    }
    if(SInfo[playerid][pLeader] == 11 || SInfo[playerid][pMember] == 11)
    {
    SetPlayerPos(playerid,1278.2172,-860.6755,1084.5017);//Hitman
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,294);
    }
    if(SInfo[playerid][pLeader] == 12 || SInfo[playerid][pMember] == 12)
    {
    SetPlayerPos(playerid,-405.6271,1317.9111,12.2702);//Terroristen
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,220);
    }
    if(SInfo[playerid][pLeader] == 13 || SInfo[playerid][pMember] == 13)
    {
    SetPlayerPos(playerid,1278.2172,-860.6755,1085.0000);//Russische Mafia
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,3);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,127);
    }
    if(SInfo[playerid][pLeader] == 14 || SInfo[playerid][pMember] == 14)
    {
    SetPlayerPos(playerid,-2521.2668,-624.5107,132.7821);//CNN
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,187);
    }
    if(SInfo[playerid][pLeader] == 15 || SInfo[playerid][pMember] == 15)
    {
    SetPlayerPos(playerid,1267.7544,-869.1859,1085.0000);//atzecas
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SetPlayerVirtualWorld(playerid,4);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 4.0557);
    SetPlayerSkin(playerid,115);
    }


    }
    else
    {
    new zz = SInfo[playerid][pmietet];
    if(HausInfo[zz][Hausinterior]-1 >= 0)
    {
    new xx = HausInfo[zz][Hausinterior]-1;
    SetPlayerInterior(playerid,HausInteriorID[xx]);
    SetPlayerPos(playerid,HausInteriors[xx][0],HausInteriors[xx][1],HausInteriors[xx][2]);
    SetPlayerVirtualWorld(playerid,zz+10);
    ImHaus[playerid] = zz;
    }
    }
    }
    else
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new string[128];
    SendClientMessage(playerid,COLOR_RED,"Du bist gebannt... Mach dir gedanken warum...");
    format(string,sizeof(string),"Spieler %s wollte mit seinem gebannten Account online kommen...",name);
    SendClientMessageToAll(COLOR_RED,string);
    Kick(playerid);
    }
    }
    else
    {
    return 1;
    }
    return 0;
    }