Beiträge von CrueL

    So wird der Spieler geladen.


    stock LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))//Wir fragen ab ob der angegebene Spieler auch Online ist, und kein NPC ist (nur zur sicherhheit)
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    PlayerInfo[playerid][pLevel] = mysql_GetInt("samp_accountsi", "PlayerLevel", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCash] = mysql_GetInt("samp_accountsi", "Money", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAccount] = mysql_GetInt("samp_accountsi", "Bank", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pKills] = mysql_GetInt("samp_accountsi", "Kills", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDeaths] = mysql_GetInt("samp_accountsi", "Deaths", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAdmin] = mysql_GetInt("samp_accountsi", "AdminLevel", "Name", PlayerInfo[playerid][pName]);
    //PlayerInfo[playerid][pHealth] = mysql_GetFloat("samp_accountsi", "pHealth", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDonateRank] = mysql_GetInt("samp_accountsi", "DonateRank", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][gPupgrade] = mysql_GetInt("samp_accountsi", "UpgradePoints", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pExp] = mysql_GetInt("samp_accountsi", "Respect", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pConnectTime] = mysql_GetInt("samp_accountsi", "ConnectedTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pReg] = mysql_GetInt("samp_accountsi", "Registered", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSex] = mysql_GetInt("samp_accountsi", "Sex", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAge] = mysql_GetInt("samp_accountsi", "Age", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pOrigin] = mysql_GetInt("samp_accountsi", "Origin", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCK] = mysql_GetInt("samp_accountsi", "CK", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMuted] = mysql_GetInt("samp_accountsi", "Muted", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCrimes] = mysql_GetInt("samp_accountsi", "Crimes", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pArrested] = mysql_GetInt("samp_accountsi", "Arrested", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pWantedDeaths] = mysql_GetInt("samp_accountsi", "WantedDeaths", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPhoneBook] = mysql_GetInt("samp_accountsi", "Phonebook", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPnumber] = mysql_GetInt("samp_accountsi", "PhoneNr", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLottoNr] = mysql_GetInt("samp_accountsi", "LottoNr", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFishes] = mysql_GetInt("samp_accountsi", "Fishes", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pBiggestFish] = mysql_GetInt("samp_accountsi", "BiggestFish", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJob] = mysql_GetInt("samp_accountsi", "Job", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPayCheck] = mysql_GetInt("samp_accountsi", "Paycheck", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pHeadValue] = mysql_GetInt("samp_accountsi", "HeadValue", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJailed] = mysql_GetInt("samp_accountsi", "Jailed", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJailTime] = mysql_GetInt("samp_accountsi", "JailTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMats] = mysql_GetInt("samp_accountsi", "Materials", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrugs] = mysql_GetInt("samp_accountsi", "Drugs", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSnacks] = mysql_GetInt("samp_accountsi", "Snacks", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrinks] = mysql_GetInt("samp_accountsi", "Drinks", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pKondome] = mysql_GetInt("samp_accountsi", "Kondome", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLeader] = mysql_GetInt("samp_accountsi", "Leader", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMember] = mysql_GetInt("samp_accountsi", "Member", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pRank] = mysql_GetInt("samp_accountsi", "Rank", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pChar] = mysql_GetInt("samp_accountsi", "Skin", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pContractTime] = mysql_GetInt("samp_accountsi", "ContractTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDetSkill] = mysql_GetInt("samp_accountsi", "DetSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSexSkill] = mysql_GetInt("samp_accountsi", "SexSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pBoxSkill] = mysql_GetInt("samp_accountsi", "BoxSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLawSkill] = mysql_GetInt("samp_accountsi", "LawSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMechSkill] = mysql_GetInt("samp_accountsi", "MechSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJackSkill] = mysql_GetInt("samp_accountsi", "JackSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCarSkill] = mysql_GetInt("samp_accountsi", "CarSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pNewsSkill] = mysql_GetInt("samp_accountsi", "NewsSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrugsSkill] = mysql_GetInt("samp_accountsi", "DrugsSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCookSkill] = mysql_GetInt("samp_accountsi", "CookSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFishSkill] = mysql_GetInt("samp_accountsi", "FishSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSHealth] = mysql_GetFloat("samp_accountsi", "pSHealth", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pInt] = mysql_GetInt("samp_accountsi", "Inte", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLocal] = mysql_GetInt("samp_accountsi", "Local", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTeam] = mysql_GetInt("samp_accountsi", "Team", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pModel] = mysql_GetInt("samp_accountsi", "Model", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGPS] = mysql_GetInt("samp_accountsi", "pGps", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAngel] = mysql_GetInt("samp_accountsi", "pAngel", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg1] = mysql_GetInt("samp_accountsi", "Erfolg1", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg2] = mysql_GetInt("samp_accountsi", "Erfolg2", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg3] = mysql_GetInt("samp_accountsi", "Erfolg3", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg4] = mysql_GetInt("samp_accountsi", "Erfolg4", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPhousekey] = mysql_GetInt("samp_accountsi", "House", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPbiskey] = mysql_GetInt("samp_accountsi", "Bizz", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_x] = mysql_GetFloat("samp_accountsi", "Pos_x", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_y] = mysql_GetFloat("samp_accountsi", "Pos_y", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_z] = mysql_GetFloat("samp_accountsi", "Pos_z", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pOwnPerso] = mysql_GetInt("samp_accountsi", "pPersonalausweiß", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCarLic] = mysql_GetInt("samp_accountsi", "CarLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pNewLic] = mysql_GetInt("samp_accountsi", "NewLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFlyLic] = mysql_GetInt("samp_accountsi", "FlyLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pBoatLic] = mysql_GetInt("samp_accountsi", "BoatLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFishLic] = mysql_GetInt("samp_accountsi", "FishLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGunLic] = mysql_GetInt("samp_accountsi", "GunLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLKWLic] = mysql_GetInt("samp_accountsi", "LkwLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMotoLic] = mysql_GetInt("samp_accountsi", "MotoLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun1] = mysql_GetInt("samp_accountsi", "Gun1", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun2] = mysql_GetInt("samp_accountsi", "Gun2", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun3] = mysql_GetInt("samp_accountsi", "Gun3", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun4] = mysql_GetInt("samp_accountsi", "Gun4", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo1] = mysql_GetInt("samp_accountsi", "Ammo1", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo2] = mysql_GetInt("samp_accountsi", "Ammo2", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo3] = mysql_GetInt("samp_accountsi", "Ammo3", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo4] = mysql_GetInt("samp_accountsi", "Ammo4", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCarTime] = mysql_GetInt("samp_accountsi", "CarTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPayDay] = mysql_GetInt("samp_accountsi", "PayDay", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPayDayHad] = mysql_GetInt("samp_accountsi", "PayDayHad", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCDPlayer] = mysql_GetInt("samp_accountsi", "CDplayer", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pWins] = mysql_GetInt("samp_accountsi", "Wins", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLoses] = mysql_GetInt("samp_accountsi", "Loses", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAlcoholPerk] = mysql_GetInt("samp_accountsi", "AlcoholPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrugPerk] = mysql_GetInt("samp_accountsi", "DrugPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMiserPerk] = mysql_GetInt("samp_accountsi", "MiserPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPainPerk] = mysql_GetInt("samp_accountsi", "PainPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTraderPerk] = mysql_GetInt("samp_accountsi", "TraderPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTut] = mysql_GetInt("samp_accountsi", "Tutorial", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMissionNr] = mysql_GetInt("samp_accountsi", "Mission", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pWarns] = mysql_GetInt("samp_accountsi", "Warnings", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFuel] = mysql_GetInt("samp_accountsi", "Fuel", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTankerTime] = mysql_GetInt("samp_accountsi", "TankerTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMarried] = mysql_GetInt("samp_accountsi", "Married", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMarriedTo] = mysql_GetInt("samp_accountsi", "MarriedTo", "Name", PlayerInfo[playerid][pName]);
    //PlayerInfo[playerid][pLastOnline] = mysql_GetInt("samp_accountsi", "user_lastonline", "Name", PlayerInfo[playerid][pName]);
    }
    return 1;
    }


    Login Dialog:


    if(dialogid == DIALOG_LOGIN)
    {
    if(response)
    {
    if(strlen(inputtext) == 0) //Wenn kein Passwort angegebene wurde
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Das angegebene Passwort war ungültig.\nBitte log dich jetzt mit deinem richtigen Passwort ein:","Bestätigen","Abbrechen");
    return 1;
    }
    else
    {
    new SpielerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, SpielerName, MAX_PLAYER_NAME);
    if(!strcmp(inputtext, mysql_ReturnPasswort(SpielerName), true)) // Wir holen uns das Passwort aus der MySQL Datenbank und überprüfen es mit dem angegebenen passwort.
    {
    LoadPlayer(playerid); //Der Spieler wird "geladen", sprich es werden seine Daten aus der Datenbank geholt und in variablen gespeichert um diese im Skript zu verwenden.
    ResetPlayerMoney(playerid);
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
    CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
    if(PlayerInfo[playerid][pReg] == 0)
    {
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pSHealth] = 0.0;
    PlayerInfo[playerid][pHealth] = 50.0;
    PlayerInfo[playerid][pPos_x] = 2246.6;
    PlayerInfo[playerid][pPos_y] = -1161.9;
    PlayerInfo[playerid][pPos_z] = 1029.7;
    PlayerInfo[playerid][pInt] = 15;
    PlayerInfo[playerid][pLocal] = 255;
    PlayerInfo[playerid][pTeam] = 3;
    new rand = random(sizeof(CIV));
    PlayerInfo[playerid][pModel] = CIV[rand];
    new randphone = 1000 + random(8999);//minimum 1000 max 9999 //giving one at the start
    PlayerInfo[playerid][pPnumber] = randphone;
    PlayerInfo[playerid][pPhousekey] = 255;
    PlayerInfo[playerid][pPbiskey] = 255;
    PlayerInfo[playerid][pAccount] = 30000;
    PlayerInfo[playerid][pReg] = 1;
    }
    if(PlayerInfo[playerid][pLevel] == -999) //autoban
    {
    format(string,sizeof(string),"AdmCmd: %s versuchte sicht mit seinem gebannten Account einzuloggen und wurde gekickt.",SpielerName);
    SendAdminMessage(COLOR_LIGHTRED,string,1);
    SendClientMessage(playerid,COLOR_LIGHTRED,"Dein Account ist gebannt!");
    Ban(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pCK] > 0)
    {
    Kick(playerid);
    }
    printf("%s has logged in.",SpielerName);
    SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
    if(gTeam[playerid] == 0)
    {
    gTeam[playerid] = 3;
    }
    else
    {
    gTeam[playerid] = PlayerInfo[playerid][pTeam];
    }
    new tmp2[64];
    gPlayerLogged[playerid] = 1;
    SpawnPlayer(playerid);
    format(tmp2, sizeof(tmp2), "~w~Willkommen ~n~~y~ %s", SpielerName);
    DateProp(playerid);
    GameTextForPlayer(playerid, tmp2, 5000, 1);
    return 1;
    }
    else
    {
    //Wenn das Passwort falsch war, lassen wir erneut das Login fenster erscheinen damit der Spieler das Richtige Passwort eingibt.
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Das war das falsche Passwort.\nBitte log dich nun mit dem richtigen Passwort ein:","Bestätigen","Abbrechen");
    return 1;
    }
    }
    }
    else
    {
    Kick(playerid); //Wenn auf Abbrechen geklickt wurde, wird der Spieler gekickt damit man ohne Account nicht Spielen kann.
    }
    }


    Leider nicht eingerückt, Sorry!

    Hi,
    ich habe mein GF Edit in MySQL umgebastelt. >> Keine Fehler - Nicht's!
    Gut, wenn ich nun auf den Server joine und mich registriere funktioniert noch alles wunderbar, [ Nanu :D ]
    allerdings, wenn ich den Server verlasse und anschließend erneut joine und mich einlogge, bevor ich noch Spawn drücken kann... >> Server closed the Connection.


    Ich würde mich freuen, falls mir jemand über Teamviewer helfen könnte, der etwas davon versteht!


    MfG K4biX

    Wahrscheinlich hast du das so gemacht:


    stock IsPlayerAnAdmin(playerid,level)
    {
    if(GetPVarInt(playerid,"Adminlevel")>=level)return 1;
    return 0;
    }


    Falls ja, dann musst du folgendes verwenden:


    if(IsPlayerAnAdmin(pID,1)) return SendClientMessage(playerid,0xFFFFFF,"Du kannst keine Administratoren kicken.");


    public CheckWantedText()
    {
    new string[126];
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(WantedLevel[i] > 0)
    {
    format(string, sizeof(string), "[%d] %s\n Wanteds: %d\n \n",i,spName(i),WantedLevel[i]);
    GM3D[i] = Create3DTextLabel(string,0xB70000FF,0,0,0,70.5,1);
    Attach3DTextLabelToPlayer(wanted3d[i], i, 0.0, 0.0, 0.45);
    }
    }
    }
    }


    //edit Fehler behoben. So, nun einfach dein's durch dieses ersetzen!


    new jobwd;
    new mats1;
    new waffendealer[MAX_PLAYERS] = 0;
    jobwd = CreatePickup(1239,1,-1111.6533,-1677.1379,76.3672,-1);
    mats1 = CreatePickup(1318,1,-1111.6533,-1677.1379,76.3672,-1);

    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid == mats1)
    {
    if(waffendealer[playerid] == 1)
    {
    // blabla
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist kein Waffendealer!");
    return 1;
    }
    }
    }


    //edit O.o nicht gut eingerückt :D Müsste aber so funktionieren. [ Nicht getestet. ]

    Hey,


    vor kurzem habe ich mein GF - Edit in MySQL umgeschrieben, jedoch habe ich leider ein Problem beim laden der Statistiken.
    Ich würde mich freuen, wenn sich das Script jemand ansehen könnte. Momentan weiß ich leider einfach nicht weiter.


    Danke, MfG K4biX

    Dann ersetz es dadurch:


    if(GetPlayerWantedLevel(playerid) >= 1)
    {
    if(IsACop(killerid)) //Durch deine Abfrage ersetzen!
    {
    new killername[MAX_PLAYER_NAME],namex[MAX_PLAYER_NAME],str[128];
    GetPlayerName(killerid, killername, sizeof(killername));
    GetPlayerName(playerid, namex, sizeof(namex));
    format(str,sizeof(str),">> Officer %s hat den Verbrecher %s getötet. <<", killername, namex);
    SendClientMessageToAll(0xFFFFFF,str);
    }
    }


    if(GetPlayerWantedLevel(playerid) >= 1)
    {
    if(IsACop(killerid)) //Durch deine Abfrage ersetzen!
    {
    new killername[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME],string[128];
    GetPlayerName(killerid, killername, sizeof(killername));
    GetPlayerName(playerid, name, sizeof(name));
    format(string,sizeof(string),">> Officer %s hat den Verbrecher %s getötet. <<", killername, name);
    SendClientMessageToAll(0xFFFFFF,string);
    }
    }