Man kann nicht spawnen oO

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
  • Hey Leute,
    ich habe ein dummes Problem^^.
    Ich habe eine Selfmade Reallife Mode bekommen und wenn ich ich connecte bleibt das Bild
    am Startbildschirm stehen und nichts weiter passiert.
    Ich habe mir dabei Gedacht das es am Befehl /Register oder /login liegen könnte.
    Ich poste die Befehle einfach mal hier ins Board und ich hoffe ihr könnt mir helfen:



    if(strcmp(cmd, "/register", true) == 0)
    {
    new playername[32];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(file, sizeof(file), "/Accounts/%s.ini", sendername);
    tmp = strtok(cmdtext, idx);
    GetPlayerName(playerid, playername, sizeof(playername));
    if(20 < strlen(tmp) || strlen(tmp) < 4)
    {
    SendClientMessage(playerid, COLOR_DBLUE, "Fehler! Das Passwort muss länger als 4 Buchstaben sein!");
    return 1;
    }
    if(!strlen(tmp))
    SendClientMessage(playerid, COLOR_DBLUE, "[BENUTZUNG]: /register [Passwort]");


    else
    {
    if (!dini_Exists(file))
    {
    GetPlayerIp(playerid, playerip, sizeof(playerip));
    TotalRegs = dini_Int("/Stats/Registern.cfg", "TotalREG");
    TotalRegs += 1;
    dini_IntSet("/Stats/Registern.cfg", "TotalREG", TotalRegs);
    dini_Create(file);
    dini_IntSet(file, "password", udb_hash(tmp));
    dini_Set(file,"pass", tmp);
    dini_IntSet(file, "level", 0);
    dini_Set(file, "IP", playerip);
    dini_IntSet(file, "Level", 0);
    dini_IntSet(file, "Money", 30000);
    dini_IntSet(file, "uid", TotalRegs);
    dini_IntSet(file, "Jail", 0);
    dini_IntSet(file, "Driverlicense", 0);
    dini_IntSet(file, "Driverlicenselkw", 0);
    dini_IntSet(file, "Driverlicenseboot", 0);
    dini_IntSet(file, "Driverlicenseflug", 0);
    dini_IntSet(file, "Driverlicenserad", 0);
    dini_IntSet(file, "Nitroschein", 0);
    dini_IntSet(file, "Waffenschein", 0);
    dini_IntSet(file, "PunktInFlensburg", 0);
    dini_IntSet(file, "Police", 0);
    dini_IntSet(file, "Army", 0);
    dini_IntSet(file, "Militaer", 0);
    dini_IntSet(file, "Adac", 0);
    dini_IntSet(file, "Fahrlehrer", 0);
    dini_IntSet(file, "Fluglehrer", 0);
    dini_IntSet(file, "Bootslehrer", 0);
    dini_IntSet(file, "Sanitary", 0);
    dini_IntSet(file, "SPSSF", 0);
    dini_IntSet(file, "SPSLS", 0);
    dini_IntSet(file, "SPSLV", 0);
    dini_IntSet(file, "Medic", 0);
    dini_IntSet(file, "Taxi", 0);
    dini_IntSet(file, "LKW", 0);
    dini_IntSet(file, "OilCompany", 0);
    dini_IntSet(file, "Mafia", 0);
    dini_IntSet(file, "Barkeeper", 0);
    dini_IntSet(file, "Autohaus", 0);
    dini_IntSet(file, "Skinid", 1);
    dini_IntSet(file, "Bank", 0);
    dini_IntSet(file, "BankMoney", 0);
    dini_IntSet(file, "Leben", 100);
    dini_IntSet(file, "Armor", 0);
    dini_FloatSet(file, "Promille", 0);
    dini_IntSet(file, "Handy", 0);
    dini_FloatSet(file, "xcoords", -1426.3771);
    dini_FloatSet(file, "ycoords", -287.6837);
    dini_FloatSet(file, "zcoords", 14.1484);
    format(string, sizeof(string), "%s(%i) hat sich registriert mit folgendem Passwort \"%s\"", playername, playerid, tmp);
    printf(string);
    format(string, sizeof(string), "Du bist nun registriert! Tippe /login [Passwort]");
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    GameTextForPlayer(playerid,"Willkommen!",4000,3);
    SetCameraBehindPlayer(playerid);
    TogglePlayerControllable(playerid, 0);
    SendClientMessage(playerid, COLOR_RED, "Nun kommt ein kleines Tutorial");
    SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "Du bist schon registriert!");
    }
    }


    return 1;
    }



    if(strcmp(cmd, "/login", true) == 0)
    {
    if(alogin[playerid] == 0)
    {
    new playername[32];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(file, sizeof(file), "/Accounts/%s.ini", sendername);
    if(logged[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_RED, "Du bist schon eingeloggt!");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    GetPlayerName(playerid, playername, sizeof(playername));
    if(!strlen(tmp))
    SendClientMessage(playerid, COLOR_WHITE, "[BENUTZUNG]: /login [Passwort]");
    else
    {
    if(dini_Exists(file))
    {
    tmp2 = dini_Get(file, "password");
    if(udb_hash(tmp) != strval(tmp2))
    {
    SendClientMessage(playerid,COLOR_RED, "Du hast ein falsches Passwort benutzt");
    }
    else
    {
    GetPlayerIp(playerid, playerip, sizeof(playerip));
    dini_Set(file,"pass",tmp);
    PlayerInfo[playerid][Level] = dini_Int(file, "level");
    PlayerInfo[playerid][Money] = dini_Int(file, "Money");
    PlayerInfo[playerid][xcoords] = dini_Int(file, "xcoords");
    PlayerInfo[playerid][ycoords] = dini_Int(file, "ycoords");
    PlayerInfo[playerid][zcoords] = dini_Int(file, "zcoords");
    PlayerInfo[playerid][acoords] = dini_Int(file, "acoords");
    PlayerInfo[playerid][Ip] = dini_Int(file, "IP");
    dini_Set(file, "IP_NEW",playerip);
    PlayerInfo[playerid][uid] = dini_Int(file, "uid");
    PlayerInfo[playerid][Jail] = dini_Int(file, "Jail");
    PlayerInfo[playerid][Driverlicense] = dini_Int(file, "Driverlicense");
    PlayerInfo[playerid][Driverlicenselkw] = dini_Int(file, "Driverlicenselkw");
    PlayerInfo[playerid][Driverlicenseboot] = dini_Int(file, "Driverlicenseboot");
    PlayerInfo[playerid][Driverlicenseflug] = dini_Int(file, "Driverlicenseflug");
    PlayerInfo[playerid][Driverlicenserad] = dini_Int(file, "Driverlicenserad");
    PlayerInfo[playerid][Nitroschein] = dini_Int(file, "Nitroschein");
    PlayerInfo[playerid][Waffenschein] = dini_Int(file, "Waffenschein");
    PlayerInfo[playerid][PunktInFlensburg] = dini_Int(file, "PunktInFlensburg");
    PlayerInfo[playerid][Police] = dini_Int(file, "Police");
    PlayerInfo[playerid][Army] = dini_Int(file, "Army");
    PlayerInfo[playerid][Militaer] = dini_Int(file, "Militaer");
    PlayerInfo[playerid][Adac] = dini_Int(file, "Adac");
    PlayerInfo[playerid][Fahrlehrer] = dini_Int(file, "Fahrlehrer");
    PlayerInfo[playerid][Fluglehrer] = dini_Int(file, "Fluglehrer");
    PlayerInfo[playerid][Bootslehrer] = dini_Int(file, "Bootslehrer");
    PlayerInfo[playerid][Sanitary] = dini_Int(file, "Sanitary");
    PlayerInfo[playerid][SPSSF] = dini_Int(file, "SPSSF");
    PlayerInfo[playerid][SPSLV] = dini_Int(file, "SPSLV");
    PlayerInfo[playerid][SPSLS] = dini_Int(file, "SPSLS");
    PlayerInfo[playerid][Medic] = dini_Int(file, "Medic");
    PlayerInfo[playerid][Taxi] = dini_Int(file, "Taxi");
    PlayerInfo[playerid][LKW] = dini_Int(file, "LKW");
    PlayerInfo[playerid][OilCompany] = dini_Int(file, "OilCompany");
    PlayerInfo[playerid][Mafia] = dini_Int(file, "Mafia");
    PlayerInfo[playerid][Barkeeper] = dini_Int(file, "Barkeeper");
    PlayerInfo[playerid][Autohaus] = dini_Int(file, "Autohaus");
    PlayerInfo[playerid][Skinid] = dini_Int(file, "Skinid");
    PlayerInfo[playerid][Bank] = dini_Int(file, "Bank");
    PlayerInfo[playerid][BankMoney] = dini_Int(file, "BankMoney");
    PlayerInfo[playerid][Leben] = dini_Int(file, "Leben");
    PlayerInfo[playerid][Armor] = dini_Int(file, "Armor");
    PlayerInfo[playerid][Promille] = dini_Int(file, "Promille");
    PlayerInfo[playerid][pHandy] = dini_Int(file, "Handy");
    format(string, sizeof(string), "%s betritt den Server!", playername);
    Team[playerid]=TEAM_BUERGER;
    logged[playerid] = 1;
    SpawnPlayer(playerid);
    SendClientMessageToAll(COLOR_GREEN, string);
    SetPlayerSkin(playerid,PlayerInfo[playerid][Skinid]);
    GivePlayerMoney(playerid,PlayerInfo[playerid][Money]);
    SetPlayerColor(playerid, 0xAFAFAF00);
    GameTextForPlayer(playerid, "~b~Willkommen!",2000,1);
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist nicht registriert!");
    }
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du wirst automatisch eingeloggt!");
    }
    return 1;
    }


    MfG Markus

  • Bei OnPlayerConnect ist auch alles richtig!



    public OnPlayerConnect(playerid)
    {
    SendClientMessage(playerid,COLOR_WHITE,"Reallife Server");
    PlayerInfo[playerid][Level] = 0;
    show[playerid]=0;
    InAfk[playerid] = 0;
    skinsel[playerid]=0;


    SetPlayerMapIcon(playerid, 1,1381.5916,460.0637,20.3452, 42,0);
    SetPlayerMapIcon(playerid, 2,-90.5369,-1168.9703,2.1820, 42,0);
    SetPlayerMapIcon(playerid, 3,1942.3906,-1772.5172,13.6406, 42,0);
    SetPlayerMapIcon(playerid, 4,-1763.7607,-157.2220,3.5547, 42,0);
    SetPlayerMapIcon(playerid, 5,-1675.7466,412.0922,7.0585, 42,0);
    SetPlayerMapIcon(playerid, 6,-2410.9175,975.1121,45.4609, 42,0);
    SetPlayerMapIcon(playerid, 7,-1509.6648,1367.5077,2.3608, 42,0);
    SetPlayerMapIcon(playerid, 8,2114.7983,920.9956,10.5474, 42,0);
    SetPlayerMapIcon(playerid, 9,2203.3120,2477.0435,10.5474, 42,0);
    SetPlayerMapIcon(playerid, 10,1598.5481,2198.2209,10.5474, 42,0);
    SetPlayerMapIcon(playerid, 11,-1472.1906,1863.6604,32.3599, 42,0);
    SetPlayerMapIcon(playerid, 12,-1328.7777,2671.7478,49.7896, 42,0);
    SetPlayerMapIcon(playerid, 13,2638.7524,1105.3854,10.8203, 42,0);
    SetPlayerMapIcon(playerid, 14,2147.5476,2747.4390,10.4215, 42,0);
    SetPlayerMapIcon(playerid, 15,1313.3556,1443.4410,10.5437, 42,0);
    SetPlayerMapIcon(playerid, 16,1595.3259,2199.5366,10.5474, 42,0);
    SetPlayerMapIcon(playerid, 17,2202.1912,2476.4431,10.5474, 42,0);
    SetPlayerMapIcon(playerid, 18,2115.4080,920.0892,10.5474, 42,0);
    SetPlayerMapIcon(playerid, 19,2639.2358,1105.5243,10.5466, 42,0);
    SetPlayerMapIcon(playerid, 20,2146.6860,2748.5156,10.5474, 42,0);


    SetPlayerMapIcon(playerid, 20, -2031.5264,-115.0522,1035.1719, 36, 0 );
    SetPlayerMapIcon(playerid, 21, -1952.7032,289.3990,41.0471, 55, 0 );
    SetPlayerMapIcon(playerid, 22, -2156.3599,-225.0340,35.3203, 22, 0 );
    SetPlayerMapIcon(playerid, 23, -1619.0555,691.2572,7.1875, 30, 0 );
    SetPlayerMapIcon(playerid, 24, -1863.8690,1064.2955,46.0859, 52, 0 );

    PlayerPlaySound(playerid, MUSIC_ON, -2690.67,2048.35,56.73);
    tanke[playerid]=0;
    Handy[playerid] = false;
    handschellen[playerid]=0;
    SendClientMessage(playerid,COLOR_ORANGE,"Verbindung wird hergestellt...");


    FF[playerid] = 4.1;
    o1[playerid] = 0;
    o2[playerid] = 1;
    o3[playerid] = 1;
    o4[playerid] = 1;
    o5[playerid] = 1;
    alogin[playerid]=0;
    return 1;
    }


    Und bei OnPLayerSpawn und OnGameModeInit auch.
    Außerdem wenn ich die server exe starte laden auch keine Vehicles!
    Siehe hier: