Problem mit /startbonus

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 habe heute ein problem mit dem befehl /startbonus


    Die meisten müssten von euch das script gne kennen (ein gf),Der befehl /startbonus von da hat mir nicht gefallen also habe ich ihn verändert,so wenn /startbonus eingebe kommt ein Dialog mit 3 auswahlen (DIALOG_STYLE_LIST) und zwar wenn ich dann eins Auswähle komm die nachricht an alle das der spieler den startbonus bekommen hat danach schlies sich die samp server.exe???


    Der start bonus befehl:


    if(strcmp(cmd, "/startbonus", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLevel] == 1 || PlayerInfo[playerid][pLevel] == 2 || PlayerInfo[playerid][pSB] == 0)
    {
    ShowPlayerDialog(playerid,startbonus,DIALOG_STYLE_LIST,"StarterPack","1. 7000$+Level3\n2. Führerschein\n3. Motorrad","Wählen","Abbrechen");

    }
    else {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Level 1/2 mehr oder du hattest deinen Startbonus schon");
    return 1;
    }


    }
    return 1;
    }


    Dialog:


    if(dialogid==startbonus)
    {
    if(response==0)
    {
    return 1;
    }
    if(response==1)
    {


    }
    switch(listitem)
    {
    case 0:
    {
    #define START "7000$+Level 3"

    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    new string[128];
    GivePlayerMoney(playerid, 7000); /// Geld was der Spieler bekommt
    PlayerInfo[playerid][pLevel] = 3; // Level was der Spieler bekommt
    format(string,sizeof(string)," %s hat das Starter Paket bekommen [%s]",name,START);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du hast den Startbonus bekommen[%s]",START);
    }
    case 1:
    {
    #define START1 "Führerschein"
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string)," %s hat den Startbonus bekommen[%s]",name,START1);
    PlayerInfo[playerid][pCarLic]=1;
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Du hast den %s bekommen",START1);
    }
    case 2:
    {
    #define START2 "Motorradschein"
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"%s hat den StartBonus Bekommen[%s]",name,START2);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du hast den Startbonus bekommen [%s]");

    }
    }
    }


    hoffe ihr könnt mir helfen

  • Mach die Defines am besten global....


    Sprich:
    #define START "7000$+Level 3"
    #define START1 "Führerschein"
    #define START2 "Motorradschein"


    Erstmal danke weil der server online bleib nur das neue problem is das dann der registerr kommt und man ein neues passwort eingeben kann??


    Und genau das möchte ich nicht....


    Pawn Code:


    if(dialogid==startbonus)
    {
    if(response==0)
    {
    PlayerInfo[playerid][pSB]=0;
    return 1;
    }
    if(response==1)
    {


    }
    switch(listitem)
    {
    case 0:
    {


    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    new string[128];
    GivePlayerMoney(playerid, 7000); /// Geld was der Spieler bekommt
    PlayerInfo[playerid][pLevel] = 3; // Level was der Spieler bekommt
    format(string,sizeof(string)," %s hat das Starter Paket bekommen [7000$+Level]",name);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du hast den Startbonus bekommen[7000$+Level]");
    PlayerInfo[playerid][pSB]=1;
    }
    case 1:
    {

    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string)," %s hat den Startbonus bekommen[Führerschein]",name);
    PlayerInfo[playerid][pCarLic]=1;
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Du hast den Startbonus bekommen[Führerschein]");
    PlayerInfo[playerid][pSB]=1;
    }
    case 2:
    {

    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"%s hat den StartBonus Bekommen[%s]",name);
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du hast den Startbonus bekommen [Motorradschein]");
    PlayerInfo[playerid][pSB]=1;

    }
    }
    }


    format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    format(var, 32, "pSB=%d\n",PlayerInfo[playerid][pSB]);fwrite(hFile, var);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
    format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    format(var, 32, "Supporter=%d\n",PlayerInfo[playerid][pSupporter]);fwrite(hFile, var);
    format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pDonateRank]);fwrite(hFile, var);
    format(var, 32, "UpgradePoints=%d\n",PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var);
    format(var, 32, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
    format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
    format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
    format(var, 32, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
    format(var, 32, "Origin=%d\n",PlayerInfo[playerid][pOrigin]);fwrite(hFile, var);
    format(var, 32, "CK=%d\n",PlayerInfo[playerid][pCK]);fwrite(hFile, var);
    format(var, 32, "Muted=%d\n",PlayerInfo[playerid][pMuted]);fwrite(hFile, var);
    format(var, 32, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
    format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
    format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pAccount]);fwrite(hFile, var);
    format(var, 32, "Kredit=%d\n",PlayerInfo[playerid][pPlayerKredit]);fwrite(hFile, var);
    format(var, 32, "KreditDauer=%d\n",PlayerInfo[playerid][pPlayerKreditDauer]);fwrite(hFile, var);
    format(var, 32, "Crimes=%d\n",PlayerInfo[playerid][pCrimes]);fwrite(hFile, var);
    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, "Arrested=%d\n",PlayerInfo[playerid][pArrested]);fwrite(hFile, var);
    format(var, 32, "WantedDeaths=%d\n",PlayerInfo[playerid][pWantedDeaths]);fwrite(hFile, var);
    format(var, 32, "Phonebook=%d\n",PlayerInfo[playerid][pPhoneBook]);fwrite(hFile, var);
    format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
    format(var, 32, "Fishes=%d\n",PlayerInfo[playerid][pFishes]);fwrite(hFile, var);
    format(var, 32, "BiggestFish=%d\n",PlayerInfo[playerid][pBiggestFish]);fwrite(hFile, var);
    format(var, 32, "Job=%d\n",PlayerInfo[playerid][pJob]);fwrite(hFile, var);
    format(var, 32, "Paycheck=%d\n",PlayerInfo[playerid][pPayCheck]);fwrite(hFile, var);
    format(var, 32, "HeadValue=%d\n",PlayerInfo[playerid][pHeadValue]);fwrite(hFile, var);
    format(var, 32, "Jailed=%d\n",PlayerInfo[playerid][pJailed]);fwrite(hFile, var);
    format(var, 32, "GangJailed=%d\n",PlayerInfo[playerid][pGangJailed]);fwrite(hFile, var);
    format(var, 32, "Mauled=%d\n",PlayerInfo[playerid][pMauled]);fwrite(hFile, var);
    format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
    format(var, 32, "Materials=%d\n",PlayerInfo[playerid][pMats]);fwrite(hFile, var);
    format(var, 32, "Drugs=%d\n",PlayerInfo[playerid][pDrugs]);fwrite(hFile, var);
    format(var, 32, "BoxMaterials=%d\n",PlayerInfo[playerid][pBoxMats]);fwrite(hFile, var);
    format(var, 32, "BoxDrugs=%d\n",PlayerInfo[playerid][pBoxDrugs]);fwrite(hFile, var);
    format(var, 32, "FightingStyle=%d\n",GetPlayerFightingStyle(playerid));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, "FMember=%d\n",PlayerInfo[playerid][pFMember]);fwrite(hFile, var);
    format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
    format(var, 32, "Char=%d\n",PlayerInfo[playerid][pChar]);fwrite(hFile, var);
    format(var, 32, "ContractTime=%d\n",PlayerInfo[playerid][pContractTime]);fwrite(hFile, var);
    format(var, 32, "DetSkill=%d\n",PlayerInfo[playerid][pDetSkill]);fwrite(hFile, var);
    format(var, 32, "SexSkill=%d\n",PlayerInfo[playerid][pSexSkill]);fwrite(hFile, var);
    format(var, 32, "BoxSkill=%d\n",PlayerInfo[playerid][pBoxSkill]);fwrite(hFile, var);
    format(var, 32, "LawSkill=%d\n",PlayerInfo[playerid][pLawSkill]);fwrite(hFile, var);
    format(var, 32, "MechSkill=%d\n",PlayerInfo[playerid][pMechSkill]);fwrite(hFile, var);
    format(var, 32, "JackSkill=%d\n",PlayerInfo[playerid][pJackSkill]);fwrite(hFile, var);
    format(var, 32, "CarSkill=%d\n",PlayerInfo[playerid][pCarSkill]);fwrite(hFile, var);
    format(var, 32, "NewsSkill=%d\n",PlayerInfo[playerid][pNewsSkill]);fwrite(hFile, var);
    format(var, 32, "DrugsSkill=%d\n",PlayerInfo[playerid][pDrugsSkill]);fwrite(hFile, var);
    format(var, 32, "CookSkill=%d\n",PlayerInfo[playerid][pCookSkill]);fwrite(hFile, var);
    format(var, 32, "FishSkill=%d\n",PlayerInfo[playerid][pFishSkill]);fwrite(hFile, var);
    format(var, 32, "pSHealth=%.1f\n",PlayerInfo[playerid][pSHealth]);fwrite(hFile, var);
    GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
    format(var, 32, "pHealth=%.1f\n",PlayerInfo[playerid][pHealth]);fwrite(hFile, var);
    format(var, 32, "Int=%d\n",PlayerInfo[playerid][pInt]);fwrite(hFile, var);
    format(var, 32, "Local=%d\n",PlayerInfo[playerid][pLocal]);fwrite(hFile, var);
    format(var, 32, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
    format(var, 32, "Model=%d\n",PlayerInfo[playerid][pModel]);fwrite(hFile, var);
    format(var, 32, "PhoneNr=%d\n",PlayerInfo[playerid][pPnumber]);fwrite(hFile, var);
    format(var, 32, "House=%d\n",PlayerInfo[playerid][pPhousekey]);fwrite(hFile, var);
    format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
    format(var, 32, "GWD=%f\n",PlayerInfo[playerid][pGWD]);fwrite(hFile, var);
    format(var, 32, "HandyGeld=%d\n",PlayerInfo[playerid][pHandyGeld]);fwrite(hFile, var);
    format(var, 32, "HandyVer=%d\n",PlayerInfo[playerid][pHandyVer]);fwrite(hFile, var);


  • Kannst du, ich habe nur Gefragt warum du es so machst :
    if(PlayerInfo[playerid][pLevel] == 1 || PlayerInfo[playerid][pLevel] == 2 || PlayerInfo[playerid][pSB]==0))
    und nicht zb so

    Spoiler anzeigen
    if(PlayerInfo[playerid][pLevel] <= 2 || PlayerInfo[playerid][pSB]==0))


    ka hab es jeztz so gemacht:


    Spoiler anzeigen
    if(PlayerInfo[playerid][pSB] == 0)
    {
    ShowPlayerDialog(playerid,startbonus,DIALOG_STYLE_LIST,"StarterPack","1. 7000$+Level3\n2. Führerschein\n3. Motorrad","Wählen","Abbrechen");

    }
    else {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Level 1/2 mehr oder du hattest deinen Startbonus schon");
    return 1;
    }



    edit: Also leute dieses Thema ist jetzt closed ich bedanke mich an alle das problem mit dem register nach dem startbonus kommt ja nur einmal

    Einmal editiert, zuletzt von BlackHuhn ()