OnPlayerRegister wie das?

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
  • Tag leute, habe eine frage und zwar wie mach ich das mit OnPlayerRegister?


    if (strcmp(cmd, "/register", true)==0)
    {
    new string[128];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "Benutze: /register [password]");
    return 1;
    }
    if (gPlayerAccount[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "Dieser Username ist schon registriert!");
    return 1;
    }
    strmid(PlayerInfo[playerid][passwort], tmp, 0, strlen(cmdtext), 255);
    Encrypt(PlayerInfo[playerid][passwort]);
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "%s.user", playername);
    new File: file = fopen(string, io_read);
    if (file)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "Diesen Benutzernamen gibt es schon.");
    fclose(file);
    return 1;
    }
    new File:hFile;
    hFile = fopen(string, io_append);
    new var[32];//
    format(var, 32, "%s\n", PlayerInfo[playerid][passwort]);fwrite(hFile, var);
    format(var, 32, "Morde=%d\n",PlayerInfo[playerid][morde]);fwrite(hFile, var);
    format(var, 32, "Tode=%d\n",PlayerInfo[playerid][tode]);fwrite(hFile, var);
    PlayerInfo[playerid][geld] = GetPlayerMoney(playerid);
    format(var, 32, "Geld=%d\n",PlayerInfo[playerid][geld]);fwrite(hFile, var);
    format(var, 32, "carlic=%d\n",Licenses[playerid][car]);fwrite(hFile, var);
    format(var, 32, "planelic=%d\n",Licenses[playerid][plane]);fwrite(hFile, var);
    format(var, 32, "boatlic=%d\n",Licenses[playerid][boat]);fwrite(hFile, var);
    format(var, 32, "bikelic=%d\n",Licenses[playerid][bike]);fwrite(hFile, var);
    PlayerInfo[playerid][score] = GetPlayerScore(playerid);
    format(var, 32, "score=%d\n",PlayerInfo[playerid][score]);fwrite(hFile, var);
    format(var, 32, "Team=%d\n",gTeam[playerid]);fwrite(hFile, var);
    format(var, 32, "adminlvl=%d\n",PlayerInfo[playerid][adminlvl]);fwrite(hFile, var);
    format(var, 32, "leader=%d\n",PlayerInfo[playerid][leader]);fwrite(hFile, var);
    PlayerInfo[playerid][skin] = GetPlayerSkin(playerid);
    format(var, 32, "SkinID=%d\n",PlayerInfo[playerid][skin]);fwrite(hFile, var);
    PlayerInfo[playerid][wantedlvl] = GetPlayerWantedLevel(playerid);
    format(var, 32, "Wanteds=%d\n",PlayerInfo[playerid][wantedlvl]);fwrite(hFile, var);
    fclose(hFile);
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "Erfolgreich registriert!!");
    SendClientMessage(playerid, COLOR_GREY, "Benutze beim nächsten Besuch /login (passwort).");
    OnPlayerLogin(playerid,PlayerInfo[playerid][passwort]);
    return 1;
    }


    ich häte das gerne so wie OnPlayerLogin nur für login