Beiträge von PermanenT

    Guten Tag,
    ich scripte an einem Drogensystem und muss sachen laden.
    Dabei stürzt der Server immer ab


    Function Connect(playerid)
    {
    new DBResult:Result,string[256],query[512];
    format(string,sizeof(string),"SELECT * FROM `Drogen` WHERE Name = '%s'",SpielerName(playerid));
    Result = db_query(Data,string);
    if(db_num_rows(Result) > 0)
    {
    db_get_field_assoc(Result,"Anzahl_1",query,5); Spieler[playerid][pSamen][0] = strval(query);
    db_get_field_assoc(Result,"Anzahl_2",query,5); Spieler[playerid][pSamen][1] = strval(query);
    db_get_field_assoc(Result,"Anzahl_3",query,5); Spieler[playerid][pSamen][2] = strval(query);


    db_get_field_assoc(Result,"Drogen_1",query,5); Spieler[playerid][pDrogen][0] = strval(query);
    db_get_field_assoc(Result,"Drogen_2",query,5); Spieler[playerid][pDrogen][1] = strval(query);
    db_get_field_assoc(Result,"Drogen_3",query,5); Spieler[playerid][pDrogen][2] = strval(query);
    }
    else
    {
    format(query,sizeof(query),"INSERT INTO `Drogen` (`Name`) VALUES ('%s')",SpielerName(playerid));
    db_query(Data,query);
    }
    db_free_result(Result);



    format(string,sizeof(string),"SELECT * FROM `DrogenAnbau` WHERE Name = '%s'",SpielerName(playerid));
    Result = db_query(Data,string);
    if(db_num_rows(Result) > 0)
    {
    db_get_field_assoc(Result,"Art",query,5); Spieler[playerid][AnbauArt] = strval(query);
    db_get_field_assoc(Result,"X",query,5); Spieler[playerid][AnBauPos][0] = floatstr(query);
    db_get_field_assoc(Result,"Y",query,5); Spieler[playerid][AnBauPos][1] = floatstr(query);
    db_get_field_assoc(Result,"Z",query,5); Spieler[playerid][AnBauPos][2] = floatstr(query);
    db_get_field_assoc(Result,"Zeit",query,5); Spieler[playerid][AnbauZeit] = strval(query);
    }
    db_free_result(Result);


    if(gettime() < Spieler[playerid][AnbauZeit])
    {
    new time = Spieler[playerid][AnbauZeit] - gettime();
    switch(Spieler[playerid][AnbauArt])
    {
    case 1: { format(string,sizeof(string),"%i:%02d von 5 Minuten\nFarmer: %s",time/60,time%60,SpielerName(playerid)); }
    case 2: { format(string,sizeof(string),"%i:%02d von 10 Minuten\nFarmer: %s",time/60,time%60,SpielerName(playerid)); }
    case 3: { format(string,sizeof(string),"%i:%02d von 15 Minuten\nFarmer: %s",time/60,time%60,SpielerName(playerid)); }
    }
    }
    else
    {
    format(string,sizeof(string),"BENUTZE: '/reduce'\nFarmer: %s",SpielerName(playerid));
    }
    Spieler[playerid][DrogenAnbau] = Create3DTextLabel(string, HELLBLAU, Spieler[playerid][AnBauPos][0],Spieler[playerid][AnBauPos][1],Spieler[playerid][AnBauPos][2], 40.0, 0, 0);


    DrogenArt[playerid]=0;
    return 1;
    }


    Es wäre echt TOP wenn ihr den fehler findet

    Guten Tag,
    ich versuche grade das mein Spieler einen anderen Kampfstyl bekommt.
    Dies funktioniert allerdings nicht. Warum
    Der Befehl:


    Der Dialog:
    ocmd:kampfstyle(playerid,params[])
    {
    ShowPlayerDialog(playerid,DIALOG_KAMPFSTYLE,DIALOG_STYLE_LIST,"Kampfstyle [MENU]","Boxen(5000$)\nKung Fu(5000$)\nKneehead(5000$)\nGrabkick(5000$)\nElbow(5000$","Erlernen","Abbrechen");
    return 1;
    }
    case DIALOG_KAMPFSTYLE:
    {
    if(response)
    {
    if(Spieler[playerid][Money] < 5000)return SendClientMessage(playerid,GRAU,"Du hast keine 5000€ auf der Hand!");
    switch(listitem)
    {
    case 0: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING); Spieler[playerid][pFightStyle]=listitem+1;}
    case 1: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU); Spieler[playerid][pFightStyle]=listitem+1;}
    case 2: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD); Spieler[playerid][pFightStyle]=listitem+1;}
    case 3: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK); Spieler[playerid][pFightStyle]=listitem+1;}
    case 4: { SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW); Spieler[playerid][pFightStyle]=listitem+1;}
    }
    GivePlayerCash(playerid,-5000);
    return 1;
    }
    return 1;
    }


    Man Kämpft immernoch normal

    Hey,
    es gibt sicherlich ein Truckerscript
    Auch sicher auf dieser plattform allerdings keins was ich kenne
    Einfach Googlen und du könntest es auch selbst schreiben

    Bitteschön


    Dabei dürfte sich dein Timer nicht wiederholen


    mach mal so


    ocmd:hans12345(playerid,params[])
    {
    SetTimerEx("HANS1",1000,false,"i",playerid);
    SetTimerEx("HANS2",1000,false,"i",playerid);
    SetTimerEx("HANS3",1000,false,"i",playerid);
    SetTimerEx("HANS4",1000,false,"i",playerid);
    return 1;
    }

    new BF_Weapon[10];


    public OnGameModeInit()
    {
    BF_Weapon[0] = CreateDynamicPickup(342, 1, 120.5242, 1934.8777, 22.7578, 7, -1, -1, 100.0); //Grenade
    BF_Weapon[1] = CreateDynamicPickup(342, 1, 279.4142, 1829.5718, 21.4766, 7, -1, -1, 100.0); //Grenade
    BF_Weapon[2] = CreateDynamicPickup(342, 1, 116.2530, 1875.0065, 22.4375, 7, -1, -1, 100.0); //Grenade
    BF_Weapon[3] = CreateDynamicPickup(342, 1, 136.4600, 1874.9723, 22.4375, 7, -1, -1, 100.0); //Grenade
    BF_Weapon[4] = CreateDynamicPickup(359, 1, 189.9938, 1940.4785, 17.6406, 7, -1, -1, 100.0); //Rocket Launcher
    BF_Weapon[5] = CreateDynamicPickup(359, 1, 206.2279, 1932.8312, 23.2422, 7, -1, -1, 100.0); //Rocket Launcher
    BF_Weapon[6] = CreateDynamicPickup(360, 1, 144.0044, 1850.1791, 25.2610, 7, -1, -1, 100.0); //Heat Seeker
    BF_Weapon[7] = CreateDynamicPickup(360, 1, 211.4619, 1809.8109, 25.1172, 7, -1, -1, 100.0); //Heat Seeker
    BF_Weapon[8] = CreateDynamicPickup(360, 1, 146.3869, 1907.3638, 26.3924, 7, -1, -1, 100.0); //Heat Seeker
    BF_Weapon[9] = CreateDynamicPickup(360, 1, 197.3199, 1835.0059, 23.2422, 7, -1, -1, 100.0); //Heat Seeker
    return DM_OnGameModeInit();
    }


    public OnPlayerPickUpDynamicPickup(playerid, pickupid)
    {
    for(new i=0;i<9;i++)
    {
    if(i==0||i==1||i==2){ GivePlayerWeapon(playerid, GRENADE, 5); }
    else if(i==3||i==4||i==5){ GivePlayerWeapon(playerid, ROCKET_LAUNCHER, 4); }
    else if(i==6||i==7||i==8||i==9){ GivePlayerWeapon(playerid, HEAT_SEEKER, 5); }
    DestroyDynamicPickup(BF_WEAPON[i]);
    SetTimerEx("PickupRespawn", 45000, false,"i",i);
    }
    return DM_OnPlayerPickUpDynamicPickup(playerid, pickupid);
    }
    forward (PickupRespawn(pickupid);
    public PickupRespawn(pickupid)
    {
    if(pickupid == BF_WEAPON[0]) return CreateDynamicPickup(342, 1, 120.5242, 1934.8777, 22.7578, 7, -1, -1, 100.0); //Grenade
    if(pickupid == BF_WEAPON[1]) return CreateDynamicPickup(342, 1, 279.4142, 1829.5718, 21.4766, 7, -1, -1, 100.0); //Grenade
    if(pickupid == BF_WEAPON[2]) return CreateDynamicPickup(342, 1, 116.2530, 1875.0065, 22.4375, 7, -1, -1, 100.0); //Grenade
    if(pickupid == BF_WEAPON[3]) return CreateDynamicPickup(342, 1, 136.4600, 1874.9723, 22.4375, 7, -1, -1, 100.0); //Grenade
    if(pickupid == BF_WEAPON[4]) return CreateDynamicPickup(359, 1, 189.9938, 1940.4785, 17.6406, 7, -1, -1, 100.0); //Rocket Launcher
    if(pickupid == BF_WEAPON[5]) return CreateDynamicPickup(359, 1, 206.2279, 1932.8312, 23.2422, 7, -1, -1, 100.0); //Rocket Launcher
    if(pickupid == BF_WEAPON[6]) return CreateDynamicPickup(360, 1, 144.0044, 1850.1791, 25.2610, 7, -1, -1, 100.0); //Heat Seeker
    if(pickupid == BF_WEAPON[7]) return CreateDynamicPickup(360, 1, 211.4619, 1809.8109, 25.1172, 7, -1, -1, 100.0); //Heat Seeker
    if(pickupid == BF_WEAPON[8]) return CreateDynamicPickup(360, 1, 146.3869, 1907.3638, 26.3924, 7, -1, -1, 100.0); //Heat Seeker
    if(pickupid == BF_WEAPON[9]) return CreateDynamicPickup(360, 1, 197.3199, 1835.0059, 23.2422, 7, -1, -1, 100.0); //Heat Seeker
    return 1;
    }



    Hatte bei der Schleife statt 9 ne 10

    HEy, tut mir leid
    hatte übersehen das du forward auch falsch hast
    Du musst da ebenfalls playerid angeben



    forward HANS1(playerid);
    forward HANS2(playerid);
    forward HANS3(playerid);
    forward HANS4(playerid);


    public HANS1(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X+2, Y, Z);
    }
    public HANS2(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X, Y+2, Z);
    }
    public HANS3(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X+4, Y, Z);
    }
    public HANS4(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X, Y+4, Z);
    }

    public HANS1(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X+2, Y, Z);
    }
    public HANS2(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X, Y+2, Z);
    }
    public HANS3(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X+4, Y, Z);
    }
    public HANS4(playerid)
    {
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X, Y+4, Z);
    }


    Erklärt sich von selbst

    Dafür gibt es funktionen wie
    PutPlayerInAnyVehicle
    und soweiter welche du nur lernst erfährst wenn du beim scripten von 0 anfängst und dich hoch arbeitest

    So war das gemeint


    Spoiler anzeigen
    public OnPlayerEnterCheckpoint(playerid)
    {
    if(TutPoint[playerid]==0)
    {
    new tutmsg2[127];
    ClearPlayerChat(playerid);
    format(tutmsg2,sizeof(tutmsg2),"Dies ist die Stadthalle.Geh hinein und besorge dir einen Perso und bei Bedarf einen Job.");
    SendClientMessage(playerid,color_tutorial,tutmsg2);
    DisablePlayerCheckpoint(playerid);
    }
    else if(TutPoint[playerid]==1)
    {
    SendClientMessage(playerid,color_tutorial,"Du brauchst einen Führerschein.Geh zum Marker und mach die Fahrprüfung.Am ende erwartet dich etwas ;)");
    DisablePlayerCheckpoint(playerid);
    }
    if(GPSCheckpoint[playerid]==1)
    {
    SendClientMessage(playerid,hblau,"*GPS* Ziel erreicht.");
    DisablePlayerCheckpoint(playerid);
    }
    else if(GPSCheckpoint[playerid]==2)
    {
    SendClientMessage(playerid,hblau,"*GPS* Ziel erreicht.");
    DisablePlayerCheckpoint(playerid);
    }
    else if(GPSCheckpoint[playerid]==3)
    {
    SendClientMessage(playerid,hblau,"*GPS* Ziel erreicht.");
    DisablePlayerCheckpoint(playerid);
    }
    else if(GPSCheckpoint[playerid]==4)
    {
    SendClientMessage(playerid,hblau,"*GPS* Ziel erreicht.");
    DisablePlayerCheckpoint(playerid);
    }
    else if(GPSCheckpoint[playerid]==5)
    {
    SendClientMessage(playerid,hblau,"*GPS* Ziel erreicht.");
    DisablePlayerCheckpoint(playerid);
    }
    else if(GPSCheckpoint[playerid]==6)
    {
    SendClientMessage(playerid,hblau,"*GPS* Ziel erreicht.");
    DisablePlayerCheckpoint(playerid);
    }

    Spoiler anzeigen
    //FAHRSCHULE
    if(FahrschulPoint[playerid]==0)
    {
    SetPlayerCheckpoint(playerid,1432.2506,-1604.8379,13.0121,4.0);
    FahrschulPoint[playerid] = 1;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==1)
    {
    SetPlayerCheckpoint(playerid,1457.0984,-1317.1260,13.0126,4.0);
    FahrschulPoint[playerid] = 2;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==2)
    {
    SetPlayerCheckpoint(playerid,1457.0653,-1171.4375,23.3390,4.0);
    FahrschulPoint[playerid] = 3;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==3)
    {
    SetPlayerCheckpoint(playerid,1442.2980,-1030.7944,23.2856,4.0);
    FahrschulPoint[playerid] = 4;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==4)
    {
    SetPlayerCheckpoint(playerid,1185.3245,-936.4529,42.3802,4.0);
    FahrschulPoint[playerid] = 5;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==5)
    {
    SetPlayerCheckpoint(playerid,1082.6434,-978.8352,40.4801,4.0);
    FahrschulPoint[playerid] = 6;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==6)
    {
    SetPlayerCheckpoint(playerid,1056.7084,-1220.7018,16.6141,4.0);
    FahrschulPoint[playerid] = 7;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==7)
    {
    SetPlayerCheckpoint(playerid,1099.1326,-1408.5835,13.0909,4.0);
    FahrschulPoint[playerid] = 8;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==8)
    {
    SetPlayerCheckpoint(playerid,1193.7501,-1555.6506,13.0122,4.0);
    FahrschulPoint[playerid] = 9;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==9)
    {
    SetPlayerCheckpoint(playerid,1295.1229,-1739.7148,13.0127,4.0);
    FahrschulPoint[playerid] = 10;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==10)
    {
    SetPlayerCheckpoint(playerid,1380.6224,-1875.4534,13.0126,4.0);
    FahrschulPoint[playerid] = 11;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==11)
    {
    SetPlayerCheckpoint(playerid,1391.8879,-1768.5414,13.0126,4.0);
    FahrschulPoint[playerid] = 12;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==12)
    {
    SetPlayerCheckpoint(playerid,1494.9071,-1735.1276,13.0126,4.0);
    FahrschulPoint[playerid] = 13;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==13)
    {
    SetPlayerCheckpoint(playerid,1531.7384,-1687.4591,13.0125,4.0);
    FahrschulPoint[playerid] = 14;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==14)
    {
    SetPlayerCheckpoint(playerid,1476.0339,-1590.1046,13.0129,4.0);
    FahrschulPoint[playerid] = 15;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==15)
    {
    SetPlayerCheckpoint(playerid,1426.8950,-1623.3492,13.0122,4.0);
    FahrschulPoint[playerid] = 16;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==16)
    {
    SetPlayerCheckpoint(playerid,1399.4723,-1648.4725,13.0063,4.0);
    FahrschulPoint[playerid] = 17;
    }

    Spoiler anzeigen
    else if(FahrschulPoint[playerid]==17)
    {
    new curveh;
    curveh = GetPlayerVehicleID(playerid);
    SetVehicleToRespawn(curveh);
    SetPlayerPos(playerid,1371.6199,-1647.9618,13.3828);
    SetPVarInt(playerid,"Autoschein",1);
    PlayerSpeichern(playerid);
    SendClientMessage(playerid,grün,"Du hast deine Fahrprüfung bestanden.Herzlichen Pflückwunsch!");
    IsInFahrschule[playerid] = 0;
    DisablePlayerCheckpoint(playerid);
    }
    return 1;
    }


    Du setzt beim Tutorial die Variable nicht hoch
    Sprich sie bleibt auf 0 oder irre ich mich?

    Hey,
    ich kann meinem Vorposter nur zustimmen.
    Du solltest am besten selbst lernen
    Mit den Tutorial hier im Forum oder halt mit MrMonatHD
    Seine neuen Videos sind ganz okay


    Du kannst dir natürlich auf ein Godfather nehmen und damit irgendwie üben
    Schauen wie was geht