Beiträge von TheTutoFreak

    Da ich das nicht so wirklich verstanden habe, habe ich mir jetzt ne MySQL Datenbank angelegt und in meinem Server eingebaut. Jetzt ist aber das Problem, dass ich schon beim Einloggen der Login Dialog nicht kommt.
    Oben im Script:

    //MySQL
    #define db_host "127.0.0.1"
    #define db_user "sampserver"
    #define db_pass "samppasswort"
    #define db_db "sampserver"
    new dbhandle;

    Bei OnGamemodeInit:

    //MySQL
    dbhandle = mysql_connect(db_host,db_user,db_db,db_pass);

    Bei OnGamemodeExit:

    mysql_close(dbhandle);

    So:

    enum fNamen{
    Zivilist,
    LSPD,
    FBI,
    Army,
    Medic,
    News,
    GmbH,
    Abfallwirtschaft,
    Hitman,
    GroveStreet,
    AlQaida,
    Ballas,
    Fahrschule,
    LaCosaNostra,
    Taxi,
    Yakuza,
    Staatsverwaltung,
    SAPD,
    Aztecas,
    Rifas,
    RS,
    Cripz,
    RussischeMafia,
    SFBC,
    Vagos,
    Wheelman
    }
    new FraktNamen[26][fNamen];

    Jetzt steht da:

    Ballas:Leader:TheTutoFreak

    Und es steht auch nur der was Online ist. Nicht alle. Und wie mache ich das, dass da steht:

    Ballas Leader: TheTutoFreak ({0x41FF00FF}Online)

    oder

    Ballas Leader: TheTutoFreak ({0xCD0000FF}Offline)

    Ich glaube du meinst das hier:

    stock FraktionsNamen(playerid)
    {
    new rankname[32];
    switch(PlayerInfo[playerid][pFraktion])
    {
    case 0: rankname="Zivilist";
    case 1: rankname="LSPD";
    case 2: rankname="FBI";
    case 3: rankname="Army";
    case 4: rankname="Medic";
    case 5: rankname="News Reporter";
    case 6: rankname="T-GmbH";
    case 7: rankname="Abfallwirtschaft";
    case 8: rankname="Hitman";
    case 9: rankname="Grove Street";
    case 10: rankname="Al-Qaida";
    case 11: rankname="Ballas";
    case 12: rankname="Fahrschule";
    case 13: rankname="La Cosa Nostra";
    case 14: rankname="Taxi";
    case 15: rankname="Yakuza";
    case 16: rankname="Staatsverwaltung";
    case 17: rankname="SAPD";
    case 18: rankname="Aztecas";
    case 19: rankname="Rifas";
    case 20: rankname="RS";
    case 21: rankname="Cripz";
    case 22: rankname="Russische Mafia";
    case 23: rankname="SFBC";
    case 24: rankname="Vagos";
    case 25: rankname="Wheelmen";
    }
    return rankname;
    }


    stock LeaderRank(playerid)
    {
    new rankname[32];
    switch(PlayerInfo[playerid][pLeader])
    {
    case 0: rankname="Zivilist";
    case 1: rankname="LSPD";
    case 2: rankname="FBI";
    case 3: rankname="Army";
    case 4: rankname="Medic";
    case 5: rankname="News Reporter";
    case 6: rankname="T-GmbH";
    case 7: rankname="Abfallwirtschaft";
    case 8: rankname="Hitman";
    case 9: rankname="Grove Street";
    case 10: rankname="Al-Qaida";
    case 11: rankname="Ballas";
    case 12: rankname="Fahrschule";
    case 13: rankname="La Cosa Nostra";
    case 14: rankname="Taxi";
    case 15: rankname="Yakuza";
    case 16: rankname="Staatsverwaltung";
    case 17: rankname="SAPD";
    case 18: rankname="Aztecas";
    case 19: rankname="Rifas";
    case 20: rankname="RS";
    case 21: rankname="Cripz";
    case 22: rankname="Russische Mafia";
    case 23: rankname="SFBC";
    case 24: rankname="Vagos";
    case 25: rankname="Wheelmen";
    }
    return rankname;
    }

    Die Fraktionen werden in den Accountdatein gespeichert:

    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);


    enum pInfo{
    pEingeloggt,
    pLevel,
    pGeschlecht,
    pAlter,
    pSpawnhealth,
    pBar,
    pBank,
    pAdminlevel,
    pEhe,
    pSpielstunden,
    pJob,
    pSkin,
    pNummer,
    pFisch,
    pBiggestFisch,
    pLevelupgrade,
    pRespekt,
    pHartz4,
    pPremium,
    pMorde,
    pTode,
    pVerbrechen,
    pKnastbesuche,
    pWantedtode,
    pWantedlevel,
    pWarn,
    pDrogen,
    pMaterialien,
    pLeader, //Leader
    pFraktion, //Fraktion
    pMember,
    pKrankheiten,
    pRank,
    pBanned,
    pAutoschein,
    pBikeschein,
    pBootschein,
    pLkwschein,
    pAngelschein,
    pFlugschein,
    pK1schein,
    pK2schein,
    pTogwhisper,
    pErlaubnis,
    pLesson
    }
    new PlayerInfo[MAX_PLAYERS][pInfo];

    Jetzt habe ich es so:

    ocmd:leaderliste(playerid,params[])
    {
    if(PlayerInfo[playerid][pEingeloggt] < 1 ) return SendClientMessage(playerid,Rot,"Du kannst diesen Befehl nicht nutzen, weil du nicht eingeloggt bist.");
    new string[1024],Leaderliste;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    //Pfad zur Datei:
    new path[128];
    format(path, sizeof(path), "Accounts/%s.txt", dini_Get(path, "Leader"));
    if(fexist(path))
    {
    //dann den Leader-Name auslesen:
    new leader[24];
    format(leader, sizeof(leader), dini_Get(path, "Leader"));
    //und dann zum string hinzufügen:
    format(string, sizeof(string), "%s%s: Leader: %s\n", string, dini_Get(path, "Leader"), leader);
    }
    }
    ShowPlayerDialog(playerid,DIALOG_LEADERS,DIALOG_STYLE_MSGBOX,"Leader Liste",Leaderliste,"Schliesen","");
    return 1;
    }

    ist das richtig ?

    Ich habe das bei OnPlayerSpawn so gemacht:

    if(PlayerInfo[playerid][pEingeloggt] == 0)
    {
    new string[128],name[MAX_PLAYER_NAME],fID = PlayerInfo[playerid][pFraktion];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{FFFFFF}%s {999999}hat den Server betreten. Herzlich Willkommen!",name);
    SendClientMessageToAll(Grau,string);
    SetPlayerPos(playerid,FraktSpawns[fID][PosX],FraktSpawns[fID][PosY],FraktSpawns[fID][PosZ]);
    SetPlayerFacingAngle(playerid,FraktSpawns[fID][PosA]);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,FraktSpawns[fID][Color]);
    SetPlayerSkin(playerid,FraktSpawns[fID][Skin]);
    PlayerInfo[playerid][pEingeloggt] = 1;
    if(KillList == 1)
    {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,200);
    }
    }
    else if(PlayerInfo[playerid][pEingeloggt] == 1)
    {
    new fID = PlayerInfo[playerid][pFraktion];
    SetPlayerPos(playerid,FraktSpawns[fID][PosX],FraktSpawns[fID][PosY],FraktSpawns[fID][PosZ]);
    SetPlayerFacingAngle(playerid,FraktSpawns[fID][PosA]);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,FraktSpawns[fID][Color]);
    SetPlayerSkin(playerid,FraktSpawns[fID][Skin]);
    PlayerInfo[playerid][pEingeloggt] = 1;
    }

    jetzt ist das aber so, dass wenn ich /makeleader Name 8 mache das da steht das ich Hitman Leader bin werde aber als Mülli gespawnt. Und wenn ich connecte steht doch dann immer in Weis statt in der Fraktionsfarbe: TheTutoFreak hat den Server betreten. Herzlich Willkommen!


    //PUSH Das Problem habe ich immer noch. :D

    Hallo Brotfische,
    ich habe in meinem Script im Moment fünf Fraktionen und möchte noch ein Paar einbauen. Allerdings ist das bissel komisch, wie ich die spawnen lasse.
    Ich habe es gerade so:

    if(PlayerInfo[playerid][pEingeloggt] == 0)
    {
    if(PlayerInfo[playerid][pFraktion] == 0)
    {
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{FFFFFF}%s {999999}hat den Server betreten. Herzlich Willkommen!",name);
    SendClientMessageToAll(Grau,string);
    SetPlayerPos(playerid,2025.0194,1008.0113,10.8203);
    SetPlayerFacingAngle(playerid,266.3221);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,Zivi);
    SetPlayerSkin(playerid,1);
    PlayerInfo[playerid][pEingeloggt] = 1;
    SendDeathMessage(INVALID_PLAYER_ID,playerid,200);
    return 1;
    }
    if(PlayerInfo[playerid][pFraktion] == 1)
    {
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{0077FF}%s {999999}hat den Server betreten. Herzlich Willkommen!",name);
    SendClientMessageToAll(Grau,string);
    SetPlayerPos(playerid,1569.7238,-1694.0360,5.8906);
    SetPlayerFacingAngle(playerid,178.3540);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,LSPD);
    SetPlayerSkin(playerid,266);
    PlayerInfo[playerid][pEingeloggt] = 1;
    SendDeathMessage(INVALID_PLAYER_ID,playerid,200);
    return 1;
    }
    if(PlayerInfo[playerid][pFraktion] == 2)
    {
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{0026FF}%s {999999}hat den Server betreten. Herzlich Willkommen!",name);
    SendClientMessageToAll(Grau,string);
    SetPlayerPos(playerid,1050.7272,1006.7212,11.0000);
    SetPlayerFacingAngle(playerid,324.5735);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,FBI);
    SetPlayerSkin(playerid,285);
    PlayerInfo[playerid][pEingeloggt] = 1;
    SendDeathMessage(INVALID_PLAYER_ID,playerid,200);
    }
    if(PlayerInfo[playerid][pFraktion] == 3)
    {
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{00FF15}%s {999999}hat den Server betreten. Herzlich Willkommen!",name);
    SendClientMessageToAll(Grau,string);
    SetPlayerPos(playerid,155.3963,1903.2561,18.6888);
    SetPlayerFacingAngle(playerid,271.1202);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,Army);
    SetPlayerSkin(playerid,287);
    PlayerInfo[playerid][pEingeloggt] = 1;
    SendDeathMessage(INVALID_PLAYER_ID,playerid,200);
    }
    if(PlayerInfo[playerid][pFraktion] == 4)
    {
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{AA0000}%s {999999}hat den Server betreten. Herzlich Willkommen!",name);
    SendClientMessageToAll(Grau,string);
    SetPlayerPos(playerid,328.6095,-1512.7717,36.0391);
    SetPlayerFacingAngle(playerid,232.0174);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,Medic);
    SetPlayerSkin(playerid,70);
    PlayerInfo[playerid][pEingeloggt] = 1;
    SendDeathMessage(INVALID_PLAYER_ID,playerid,200);
    }
    if(PlayerInfo[playerid][pFraktion] == 5)
    {
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{63CB63}%s {999999}hat den Server betreten. Herzlich Willkommen!",name);
    SendClientMessageToAll(Grau,string);
    SetPlayerPos(playerid,-2519.9355,-623.5046,132.7723);
    SetPlayerFacingAngle(playerid,2.7521);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,News);
    SetPlayerSkin(playerid,187);
    PlayerInfo[playerid][pEingeloggt] = 1;
    SendDeathMessage(INVALID_PLAYER_ID,playerid,200);
    }
    return 1;
    }
    else if(PlayerInfo[playerid][pEingeloggt] == 1)
    {
    if(PlayerInfo[playerid][pFraktion] == 0)
    {
    SetPlayerPos(playerid,2025.0194,1008.0113,10.8203);
    SetPlayerFacingAngle(playerid,266.3221);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,Zivi);
    SetPlayerSkin(playerid,1);
    PlayerInfo[playerid][pEingeloggt] = 1;
    return 1;
    }
    if(PlayerInfo[playerid][pFraktion] == 1)
    {
    SetPlayerPos(playerid,1569.7238,-1694.0360,5.8906);
    SetPlayerFacingAngle(playerid,178.3540);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,LSPD);
    SetPlayerSkin(playerid,266);
    PlayerInfo[playerid][pEingeloggt] = 1;
    return 1;
    }
    if(PlayerInfo[playerid][pFraktion] == 2)
    {
    SetPlayerPos(playerid,1050.7272,1006.7212,11.0000);
    SetPlayerFacingAngle(playerid,324.5735);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,FBI);
    SetPlayerSkin(playerid,285);
    PlayerInfo[playerid][pEingeloggt] = 1;
    return 1;
    }
    if(PlayerInfo[playerid][pFraktion] == 3)
    {
    SetPlayerPos(playerid,155.3963,1903.2561,18.6888);
    SetPlayerFacingAngle(playerid,271.1202);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,Army);
    SetPlayerSkin(playerid,287);
    PlayerInfo[playerid][pEingeloggt] = 1;
    return 1;
    }
    if(PlayerInfo[playerid][pFraktion] == 4)
    {
    SetPlayerPos(playerid,328.6095,-1512.7717,36.0391);
    SetPlayerFacingAngle(playerid,232.0174);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,Medic);
    SetPlayerSkin(playerid,70);
    PlayerInfo[playerid][pEingeloggt] = 1;
    return 1;
    }
    if(PlayerInfo[playerid][pFraktion] == 5)
    {
    SetPlayerPos(playerid,-2519.9355,-623.5046,132.7723);
    SetPlayerFacingAngle(playerid,2.7521);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,News);
    SetPlayerSkin(playerid,187);
    PlayerInfo[playerid][pEingeloggt] = 1;
    return 1;
    }
    }

    Kann ich das anders machen ? vielleicht sogar leichter ?