Kampf Styles in INI speichern

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 leute, ich wollte fragen ob mir jemand helfen kann, kampfstyles wie FIGHT_STYLE_BOXING in der ini gespeichert wird


    ich hab jetzt ein GUI system gemacht, wo man sich fightstyles aussuchen kann


    hier der code


    #define fightmenu 17
    if(strcmp("/fightstyle", cmdtext, true) == 0)
    {
    if (IsPlayerInRangeOfPoint(playerid, 3, -176.2345,1091.8066,19.7422))//eure koordinaten
    {
    ShowPlayerDialog(playerid, fightmenu, DIALOG_STYLE_LIST, "Fightstyle", "Boxing\nKungfu\nKneehead\nGrabkick\nElbow", "Auswählen", "Abbrechen");
    }
    else
    SendClientMessage(playerid, COLOR_RED, "Du bist nicht im Fitness Center!");
    }
    if(dialogid == fightmenu)
    {
    if(response)
    {
    if(listitem == 0)
    {
    SetPlayerFightingStyle (playerid,FIGHT_STYLE_BOXING);
    GivePlayerMoney(playerid, -150);
    }
    if(listitem == 1)
    {
    SetPlayerFightingStyle (playerid,FIGHT_STYLE_KUNGFU);
    GivePlayerMoney(playerid, -180);


    }
    if(listitem == 3)
    {
    SetPlayerFightingStyle (playerid,FIGHT_STYLE_KNEEHEAD);
    GivePlayerMoney(playerid, -250);
    }
    if(listitem == 4)
    {
    SetPlayerFightingStyle (playerid,FIGHT_STYLE_GRABKICK);
    GivePlayerMoney(playerid, -300);
    }
    if(listitem == 5)
    {
    SetPlayerFightingStyle (playerid,FIGHT_STYLE_ELBOW);
    GivePlayerMoney(playerid, -250);
    }



    }
    }


    ich speichere meine sachen mit pInfo
    Hoffe auf schnelle hilfe(kurze zusammen fassung: Ich möchte den code das man die fightstyles in der ini speichern kann, das man das ned immer wieder neue machen muss!!)


    MFG

  • Ich nehme mal stark an, dass du GF benutzst...


    OnPlayerLogin:
    if( strcmp( key , "FightingStyle" , true ) == 0 ) { val = ini_GetValue( Data ); SetPlayerFightingStyle(playerid,strval(val)); }


    OnPlayerRegister:
    format(var, 32, "FightingStyle=%d\n",GetPlayerFightingStyle(playerid));fwrite(hFile, var);


    OnPlayerUpdate:
    format(var, 32, "FightingStyle=%d\n",GetPlayerFightingStyle(playerid));fwrite(hFile, var);


    Ich scripte NICHT mehr, ich möchte mit NIEMANDEM einen Server aufmachen habe auch NICHTS mehr mit LoH zu tun, also lasst es mit den PNs!

  • ach hi select, ich bins nero von amigos roleplay von früher :D


    ich speichern mein zeug so


    onplayerlogin:
    format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]); fwrite(hFile, var);
    format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]); fwrite(hFile, var);
    format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]); fwrite(hFile, var);
    format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pBank]); fwrite(hFile, var);
    format(var, 32, "Team=%d\n",PlayerInfo[playerid][pTeam]); fwrite(hFile, var);
    format(var, 32, "Leader=%d\n",PlayerInfo[playerid][pLeader]); fwrite(hFile, var);
    format(var, 32, "Member=%d\n",PlayerInfo[playerid][pMember]); fwrite(hFile, var);
    format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pRank]); fwrite(hFile, var);
    format(var, 32, "Admin=%d\n",PlayerInfo[playerid][pAdmin]); fwrite(hFile, var);
    format(var, 32, "Supporter=%d\n",PlayerInfo[playerid][pSupporter]); fwrite(hFile, var);
    format(var, 32, "Skin=%d\n",PlayerInfo[playerid][pSkin]); fwrite(hFile, var);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]); fwrite(hFile, var);
    format(var, 32, "FSkin=%d\n",PlayerInfo[playerid][pFSkin]); fwrite(hFile, var);
    format(var, 32, "Knastzeit=%d\n",PlayerInfo[playerid][pKnastzeit]); fwrite(hFile, var);
    format(var, 32, "Wanteds=%d\n",PlayerInfo[playerid][pWanteds]); fwrite(hFile, var);
    format(var, 32, "Jailed=%d\n",PlayerInfo[playerid][pJailed]); fwrite(hFile, var);
    format(var, 32, "JPoints=%d\n",PlayerInfo[playerid][pJPoints]); fwrite(hFile, var);
    format(var, 32, "Knast=%d\n",PlayerInfo[playerid][pKnast]); fwrite(hFile, var);
    format(var, 32, "Drogen=%d\n",PlayerInfo[playerid][pDrogen]); fwrite(hFile, var);
    format(var, 32, "Materialien=%d\n",PlayerInfo[playerid][pMaterials]); fwrite(hFile, var);
    format(var, 32, "Points=%d\n",PlayerInfo[playerid][pPoint]); fwrite(hFile, var);
    format(var, 32, "Experince=%d\n",PlayerInfo[playerid][pExp]); fwrite(hFile, var);
    format(var, 32, "Duty=%d\n",PlayerInfo[playerid][pDuty]); fwrite(hFile, var);
    format(var, 32, "Respekt=%d\n",PlayerInfo[playerid][pRespekt]); fwrite(hFile, var);
    format(var, 32, "Nummer=%d\n",PlayerInfo[playerid][pNummer]); fwrite(hFile, var);
    format(var, 32, "Buch=%d\n",PlayerInfo[playerid][pBuch]); fwrite(hFile, var);
    format(var, 32, "AutoLiz=%d\n",PlayerInfo[playerid][pAutoLiz]); fwrite(hFile, var);
    format(var, 32, "BikeLiz=%d\n",PlayerInfo[playerid][pBikeLiz]); fwrite(hFile, var);
    format(var, 32, "FlugLiz=%d\n",PlayerInfo[playerid][pFlugLiz]); fwrite(hFile, var);
    format(var, 32, "WaffLiz=%d\n",PlayerInfo[playerid][pWaffLiz]); fwrite(hFile, var);
    format(var, 32, "AnglLiz=%d\n",PlayerInfo[playerid][pAnglLiz]); fwrite(hFile, var);
    format(var, 32, "BootLiz=%d\n",PlayerInfo[playerid][pBootLiz]); fwrite(hFile, var);
    format(var, 32, "LKWLiz=%d\n",PlayerInfo[playerid][pLKWLiz]); fwrite(hFile, var);
    format(var, 32, "Kopfgeld=%d\n",PlayerInfo[playerid][pKopfgeld]); fwrite(hFile, var);
    format(var, 32, "Opfer=%d\n",PlayerInfo[playerid][pOpfer]); fwrite(hFile, var);
    format(var, 32, "Macher=%d\n",PlayerInfo[playerid][pMacher]); fwrite(hFile, var);
    format(var, 32, "Auftrag=%d\n",PlayerInfo[playerid][pAuftrag]); fwrite(hFile, var);
    format(var, 32, "Key=%d\n",PlayerInfo[playerid][pKey]); fwrite(hFile, var);
    format(var, 32, "CarID=%d\n",PlayerInfo[playerid][pCarID]); fwrite(hFile, var);
    onplayerlogin
    if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
    if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
    if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
    if( strcmp( key , "Bank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBank] = strval( val ); }
    if( strcmp( key , "Team" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeam] = strval( val ); }
    if( strcmp( key , "Leader" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLeader] = strval( val ); }
    if( strcmp( key , "Member" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMember] = strval( val ); }
    if( strcmp( key , "Rank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pRank] = strval( val ); }
    if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
    if( strcmp( key , "Supporter" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSupporter] = strval( val ); }
    if( strcmp( key , "Skin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSkin] = strval( val ); }
    if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
    if( strcmp( key , "FSkin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFSkin] = strval( val ); }
    if( strcmp( key , "Knastzeit" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKnastzeit] = strval( val ); }
    if( strcmp( key , "Wanteds" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWanteds] = strval( val ); }
    if( strcmp( key , "Jailed" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJailed] = strval( val ); }
    if( strcmp( key , "JPoints" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJPoints] = strval( val ); }
    if( strcmp( key , "Knast" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKnast] = strval( val ); }
    if( strcmp( key , "Drogen" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrogen] = strval( val ); }
    if( strcmp( key , "Materialien" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMaterials] = strval( val ); }
    if( strcmp( key , "Points" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPoint] = strval( val ); }
    if( strcmp( key , "Experince" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExp] = strval( val ); }
    if( strcmp( key , "Duty" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDuty] = strval( val ); }
    if( strcmp( key , "Respekt" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pRespekt] = strval( val ); }
    if( strcmp( key , "Nummer" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pNummer] = strval( val ); }
    if( strcmp( key , "Buch" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBuch] = strval( val ); }
    if( strcmp( key , "AutoLiz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAutoLiz] = strval( val ); }
    if( strcmp( key , "BikeLiz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBikeLiz] = strval( val ); }
    if( strcmp( key , "FlugLiz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFlugLiz] = strval( val ); }
    if( strcmp( key , "WaffLiz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWaffLiz] = strval( val ); }
    if( strcmp( key , "AnglLiz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAnglLiz] = strval( val ); }
    if( strcmp( key , "BootLiz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBootLiz] = strval( val ); }
    if( strcmp( key , "LKWLiz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLKWLiz] = strval( val ); }
    if( strcmp( key , "Kopfgeld" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKopfgeld] = strval( val ); }
    if( strcmp( key , "Opfer" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pOpfer] = strval( val ); }
    if( strcmp( key , "Macher" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMacher] = strval( val ); }
    if( strcmp( key , "Auftrag" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAuftrag] = strval( val ); }
    if( strcmp( key , "Key" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKey] = strval( val ); }
    if( strcmp( key , "CarID" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarID] = strval( val ); }
    und onplayerregister hab ich ned

  • hehe moin moin :D auch hier ^^


    also.. sieht wie gf aus ^^


    aber.. jetzt hast du oben im script wahrscheinlich enum pInfo oder so was..


    dort machst du für den fightstyle z.B.


    enum pInfo
    {
    //code
    pFightstyle,
    };


    dann dort wo du den fightstyle aussuchen kannst


    SetPlayerFightingStyle(playerid, fightstyle);
    PlayerInfo[playerid][pFightstyle] = GetPlayerFightingStyle(playerid);


    OnPlayerUpdate nehm ich mal an ist das erste... (das würd ich aber aus onplayerupdate rausnehmen, da onplayerupdate ressourcen schluckt, wenn zuviel da drin is ;) :(


    format(var, 32, "Fightstyle=%d\n",PlayerInfo[playerid][pFightstyle]);fwrite(hFile, var);


    OnPlayerLogin:


    if( strcmp( key , "Fightstyle" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFightstyle] = strval( val ); }
    SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightstyle])


    sollte so eigentlich gehn...


    MFG selEcT

  • Ich muss dich(Sonic) ohne unfreundlich zu werden mal darauf hinweisen, dass das genau dasselbe Accountsystem ist und du es genauso einfügen kannst, wie ich es geschrieben hab.
    Hätte man auch selber sehen können.


    EDIT: Ich werd auch immer langsamer...


    Ich scripte NICHT mehr, ich möchte mit NIEMANDEM einen Server aufmachen habe auch NICHTS mehr mit LoH zu tun, also lasst es mit den PNs!

  • keine errors, ich werde es mal testen danke!


    //edit: es geht, vielen dank!!


    ich close hier mal

    Einmal editiert, zuletzt von [GGR]SoNiC ()