Beiträge von Dachdecker

    Versuchs mal mit "i"


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(GetPlayerState(playerid)== PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(VehicleInfoDraw); i++) PlayerTextDrawShow(playerid,VehicleInfoDraw[playerid][i]);
    SetTimerEx("DestroyCarInfo", 5000, 0, "i", playerid);
    }
    return 1;
    }
    //Fahrzeug Informationen löschen
    forward DestroyCarInfo(playerid);
    public DestroyCarInfo(playerid)
    {
    for(new i=0; i<sizeof(VehicleInfoDraw); i++) PlayerTextDrawDestroy(playerid,VehicleInfoDraw[playerid][i]);
    return 1;
    }

    if( GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK )
    {
    SetTimerEx("Waffeauf", 1000, false, "i", playerid);
    for(new i = 0; i<sizeof(WeaponPickups); i++)
    {
    if(GetWeaponPickup(WeaponPickups[i][WeaponPickupWeaponID]) == WeaponPickups[i][WeaponPickupID])
    {
    GivePlayerWeapon(playerid, WeaponPickups[i][WeaponPickupWeaponID], WeaponPickups[i][WeaponPickupAmmo]);



    WeaponPickups[i][WeaponPickupID] = 0;
    WeaponPickups[i][WeaponPickupWeaponID] = 0;
    WeaponPickups[i][WeaponPickupAmmo] = 0;
    break;
    }
    }
    }

    also soll das break da raus ok. und wie mach das jz wegen PickupID und WeaponPickupID...



    Hab das jetzt mal so gemacht:



    if( GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK )
    {
    SetTimerEx("Waffeauf", 1000, false, "i", playerid);
    for(new i = 0; i<sizeof(WeaponPickups); i++)
    {
    if(pickupid == GetWeaponPickup(WeaponPickups[i][WeaponPickupWeaponID]))
    {
    GivePlayerWeapon(playerid, WeaponPickups[i][WeaponPickupWeaponID], WeaponPickups[i][WeaponPickupAmmo]);



    WeaponPickups[i][WeaponPickupID] = 0;
    WeaponPickups[i][WeaponPickupWeaponID] = 0;
    WeaponPickups[i][WeaponPickupAmmo] = 0;
    }
    }
    }


    for(new i = 0; i<sizeof(WeaponPickups); i++)
    {
    if(WeaponPickups[i][WeaponPickupID] == 0)
    {
    WeaponPickups[i][WeaponPickupID] = GetWeaponPickup(waffe);
    WeaponPickups[i][WeaponPickupWeaponID] = waffe;
    WeaponPickups[i][WeaponPickupAmmo] = ammo;
    break;
    }
    }



    if( GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK )
    {
    DestroyPickup(WaffendurchTot);
    SetTimerEx("Waffeauf", 1000, false, "i", playerid);
    for(new i = 0; i<sizeof(WeaponPickups); i++)
    {
    GivePlayerWeapon(playerid, WeaponPickups[i][WeaponPickupWeaponID], WeaponPickups[i][WeaponPickupAmmo]);



    WeaponPickups[i][WeaponPickupID] = 0;
    WeaponPickups[i][WeaponPickupWeaponID] = 0;
    WeaponPickups[i][WeaponPickupAmmo] = 0;
    break;
    }
    }

    das == war falsch :)


    nach der Abfrage jetzt ein break; sollte das break; auch bei
    WeaponPickupWeaponID,
    WeaponPickupAmmo hin?


    Ach so ja, die abfrage binde ich gleich noch mit ein und zeige dir das "Ergebnis".



    for(new i = 0; i<sizeof(WeaponPickups); i++)
    {
    if(WeaponPickups[i][WeaponPickupID] == 0)
    {
    WeaponPickups[i][WeaponPickupID] = GetWeaponPickup(waffe);
    break;
    }
    }

    @Jeffry ich bedanke mich rechtherzlich, aber ich möchte es doch lieber selber schaffen ohne Filterscript, danke für die Bereitstellung.



    @Slider


    Warningcode:
    E:\Grand Theft Auto San Andreas\Server\gamemodes\Selfmade.pwn(778) : warning 215: expression has no effect
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase




    1 Warning.



    for(new i = 0; i<sizeof(WeaponPickups); i++)
    {
    WeaponPickups[i][WeaponPickupID] == GetWeaponPickup(waffe); //Zeile 778
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    new Float: Tod_X, Float: Tod_Y, Float: Tod_Z, waffe,ammo;
    GetPlayerPos(playerid, Tod_X, Tod_Y, Tod_Z);
    waffe = GetPlayerWeapon(playerid);
    SetPVarInt(playerid, "waffenid",waffe);
    ammo = GetPlayerAmmo(playerid);
    SetPVarInt(playerid, "ammmo", ammo);
    WaffendurchTot = CreatePickup(GetWeaponPickup(waffe), 1, Tod_X, Tod_Y, Tod_Z, GetPlayerVirtualWorld(playerid));
    return 1;
    }


    if( GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK )
    {
    DestroyPickup(WaffendurchTot);
    new waffe = GetPVarInt(playerid,"waffenid"),
    ammo = GetPVarInt(playerid,"ammmo");
    GivePlayerWeapon(playerid, waffe, ammo);
    }

    Okei, 2 Fragen: Wie unterbreche ich eine schleife und wie komme ich an die Ammo der Waffe?