Beiträge von Templer

    So bad_company ich hoffe du bist zufrieden damit, hab mir extra Mühe gemacht so schön wie möglich zu Scripten für dich ^^


    #include <a_samp>


    #define Ammunationdialog (56748) //Die ID vom Dialog
    #define Ammunationdialogtext ("Nahkampfwaffen\nSchusswaffen\nSonstiges")
    #define COLOR_GREY (0xFFFFFFAA)


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/ammunation", cmdtext, true, 10) == 0)
    {
    SetPVarInt(playerid, "AmmuDialogNummer", 0);
    SetPVarInt(playerid, "AmmuWaffenChosen", 0);
    return ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_LIST, "AmmuNation", Ammunationdialogtext, "Weiter", "Abbrechen");
    }
    return 0;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == Ammunationdialog)
    {
    new string[512], cache[64];
    switch(GetPVarInt(playerid, "AmmuDialogNummer"))
    {
    case 0:
    {
    if(!response)
    {
    DeletePVar(playerid, "AmmuDialogNummer");
    DeletePVar(playerid, "AmmuWaffenChosen");
    return SendClientMessage(playerid, COLOR_GREY, "Danke für deinen Besuch...");
    }
    SetPVarInt(playerid, "AmmuDialogNummer", GetPVarInt(playerid, "AmmuDialogNummer")+listitem+1);
    switch(listitem)
    {
    case 0: ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_LIST, "AmmuNation", "Messer\nBaseballschläger", "Auswählen", "Zurück");
    case 1: ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_LIST, "AmmuNation", "MP5\nAK47", "Auswählen", "Zurück");
    case 2: ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_MSGBOX, "AmmuNation", "Es fällt mir nix Sonstiges ein ^^", "Ok xD", "Schade...");
    }
    }
    case 1,2: //Nahkampfwaffen
    {
    if(!response)
    {
    SetPVarInt(playerid, "AmmuDialogNummer", 0);
    return ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_LIST, "AmmuNation", Ammunationdialogtext, "Weiter", "Abbrechen");
    }
    if(GetPVarInt(playerid, "AmmuDialogNummer") == 1) {
    switch(listitem)
    {
    case 0: SetPVarInt(playerid, "AmmuWaffenChosen", 4); //Messer
    case 1: SetPVarInt(playerid, "AmmuWaffenChosen", 5); //Baseball
    }}
    else if(GetPVarInt(playerid, "AmmuDialogNummer") == 2) {
    switch(listitem)
    {
    case 0: SetPVarInt(playerid, "AmmuWaffenChosen", 29); //MP5
    case 1: SetPVarInt(playerid, "AmmuWaffenChosen", 30); //AK-47
    }}
    SetPVarInt(playerid, "AmmuDialogNummer", 4);
    GetWeaponName(GetPVarInt(playerid, "AmmuWaffenChosen"), cache, sizeof(cache));
    format(string, sizeof(string), "Wieviel Magazin von der %s möchtest du nehmen?", cache);
    return ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_INPUT, "AmmuNation", string, "Nehmen", "Zurück");
    }
    case 3:
    {
    SetPVarInt(playerid, "AmmuDialogNummer", 0);
    return ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_LIST, "AmmuNation", Ammunationdialogtext, "Weiter", "Abbrechen");
    }
    case 4:
    {
    if(!response)
    {
    SetPVarInt(playerid, "AmmuDialogNummer", 0);
    return ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_LIST, "AmmuNation", Ammunationdialogtext, "Weiter", "Abbrechen");
    }
    new ammo = strval(inputtext), slot = 0, wdata[2], wname[MAX_PLAYER_NAME];
    if(ammo < 0 || ammo > 99999) format(string, sizeof(string), "Ungültige Magazins Zahl!\nWieviel Magazin von der %s möchtest du nehmen?", cache);
    else
    {
    SetPVarInt(playerid, "AmmuDialogNummer", 3);
    GivePlayerWeapon(playerid, GetPVarInt(playerid, "AmmuWaffenChosen"), ammo);
    GetWeaponName(GetPVarInt(playerid, "AmmuWaffenChosen"), cache, MAX_PLAYER_NAME);
    format(string, sizeof(string), "Du hast dir eine %s mit %d Magazin genommen!\nDu besitzt derzeit an folgendem Waffenarsenal:\n", cache, ammo);
    for(; slot != 13; slot++)
    {
    GetPlayerWeaponData(playerid, slot, wdata[0], wdata[1]);
    GetWeaponName(wdata[0], wname, sizeof(wname));
    format(cache, sizeof(cache), "\t-> %s (%d Magazin)\n", wname, wdata[1]);
    strcat(string, cache);
    }
    return ShowPlayerDialog(playerid, Ammunationdialog, DIALOG_STYLE_MSGBOX, "AmmuNation", string, " ", "Weiter");
    }
    }
    }
    }
    return 1;
    }

    Hier bitte, habe kommentiert was falsch ist.


    stock CreateStuntTeleport(playerid,Float:X,Float:Y,Float:Z,Float:Angle,bool:WithCar,int,vir,price)
    {
    new Float:pX,Float:pY,Float:pZ;
    if(IsPlayerInAnyMinigame(playerid) == 1)
    {
    iSendClientMessage(playerid,COLOR_ERROR," You're still in a minigame. First type /exit."," Du bist schon in einem Minigame, mach erst /beenden.");
    return 0;
    }
    if(GetPlayerMoney(playerid) < price)
    {
    iSendClientMessage(playerid,COLOR_ERROR,"You haven't enough money!","Du hast zu wenig Geld!");
    return 0;
    }
    else if(!IsValidTeleVeh(GetPlayerVehicleID(playerid)) && WithCar)
    {
    iSendClientMessage(playerid,COLOR_ERROR,"This isn't a teleport valid vehicle!","Dieses Fahrzeug ist nicht zum Teleport geeignet!");
    return 0;
    }
    else if(WithCar)
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    SetVehiclePos(GetPlayerVehicleID(playerid),Float:X,Float:Y,Float:Z);
    SetVehicleZAngle(GetPlayerVehicleID(playerid),Float:Angle);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid),int);
    SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),vir);
    }
    else
    {
    SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
    SetPlayerFacingAngle(playerid,Float:Angle);
    InCar[playerid] = 0;
    }
    }
    else if(!WithCar)
    {
    SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
    SetPlayerFacingAngle(playerid,Float:Angle);
    InCar[playerid] = 0;
    }


    SetCameraBehindPlayer(playerid);
    GivePlayerMoney(playerid,-price);
    SetPlayerInterior(playerid,int);
    SetPlayerVirtualWorld(playerid,vir);
    PlayerPlaySound(playerid,1058,0,0,0);

    if(IsPlayerInAnyVehicle(playerid)) {
    FreezePlayer(playerid);
    MyState[playerid] = GetPlayerVehicleSeat(playerid); //Und nicht State, da PutPlayerInVehicle den Sitz verlang, nicht den STATE
    GetPlayerPos(playerid,pX,pY,pZ);
    SetPlayerPos(playerid,pX,pY,pZ+1.25);
    PutInCarTimer[playerid] = SetTimerEx("PutInCar",1*1000,0,"d",playerid);
    } return 1;
    }